Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision b680198012b85d4b20d9e14d6fbda379ba21a4ba)
+++ src/Parser/DeclarationNode.cc	(revision 68b52b006e663115432e37a155c3be322899e8da)
@@ -1076,8 +1076,8 @@
 	if ( variable.tyClass != TypeDecl::NUMBER_OF_KINDS ) {
 		// otype is internally converted to dtype + otype parameters
-		static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::DStype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype, TypeDecl::Dimension };
+		static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype, TypeDecl::Dimension };
 		static_assert( sizeof(kindMap) / sizeof(kindMap[0]) == TypeDecl::NUMBER_OF_KINDS, "DeclarationNode::build: kindMap is out of sync." );
 		assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." );
-		TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == TypeDecl::Otype, variable.initializer ? variable.initializer->buildType() : nullptr );
+		TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == TypeDecl::Otype || variable.tyClass == TypeDecl::DStype, variable.initializer ? variable.initializer->buildType() : nullptr );
 		buildList( variable.assertions, ret->get_assertions() );
 		return ret;
Index: tests/.expect/forall.txt
===================================================================
--- tests/.expect/forall.txt	(revision b680198012b85d4b20d9e14d6fbda379ba21a4ba)
+++ tests/.expect/forall.txt	(revision 68b52b006e663115432e37a155c3be322899e8da)
@@ -1,1 +1,1 @@
-forall.cfa:216:25: warning: Compiled
+forall.cfa:242:25: warning: Compiled
Index: tests/forall.cfa
===================================================================
--- tests/forall.cfa	(revision b680198012b85d4b20d9e14d6fbda379ba21a4ba)
+++ tests/forall.cfa	(revision 68b52b006e663115432e37a155c3be322899e8da)
@@ -199,4 +199,30 @@
 }
 
+forall( T ) void check_otype() {
+	T & tr = *0p;
+	T * tp = 0p;
+
+	&tr += 1;
+	tp += 1;
+	T & tx = tp[1];
+
+	T t;
+	T t2 = t;
+}
+
+forall( T * ) void check_dstype() {
+	T & tr = *0p;
+	T * tp = 0p;
+
+	&tr += 1;
+	tp += 1;
+	T & tx = tp[1];
+}
+
+forall( T & ) void check_dtype() {
+	T & tr = *0p;
+	T * tp = 0p;
+}
+
 //otype T1 | { void xxx( T1 ); };
 
