Index: src/Validate/LinkReferenceToTypes.cpp
===================================================================
--- src/Validate/LinkReferenceToTypes.cpp	(revision 8f31be6fe7732b7047100aa8031591434c22ee83)
+++ src/Validate/LinkReferenceToTypes.cpp	(revision b4d2b3b4081619a689af90fcbf6d98aad4304dbd)
@@ -80,51 +80,42 @@
 ast::EnumInstType const * LinkTypesCore::postvisit( ast::EnumInstType const * type ) {
 	ast::EnumDecl const * decl = symtab.lookupEnum( type->name );
+	ast::EnumInstType * mut = ast::mutate( type );
 	// It's not a semantic error if the enum is not found, just an implicit forward declaration.
 	if ( decl ) {
 		// Just linking in the node.
-		auto mut = ast::mutate( type );
 		mut->base = decl;
-		type = mut;
 	}
 	if ( !decl || !decl->body ) {
-		auto mut = ast::mutate( type );
 		forwardEnums[ mut->name ].push_back( mut );
-		type = mut;
-	}
-	return type;
+	}
+	return mut;
 }
 
 ast::StructInstType const * LinkTypesCore::postvisit( ast::StructInstType const * type ) {
 	ast::StructDecl const * decl = symtab.lookupStruct( type->name );
+	ast::StructInstType * mut = ast::mutate( type );
 	// It's not a semantic error if the struct is not found, just an implicit forward declaration.
 	if ( decl ) {
 		// Just linking in the node.
-		auto mut = ast::mutate( type );
 		mut->base = decl;
-		type = mut;
 	}
 	if ( !decl || !decl->body ) {
-		auto mut = ast::mutate( type );
 		forwardStructs[ mut->name ].push_back( mut );
-		type = mut;
-	}
-	return type;
+	}
+	return mut;
 }
 
 ast::UnionInstType const * LinkTypesCore::postvisit( ast::UnionInstType const * type ) {
 	ast::UnionDecl const * decl = symtab.lookupUnion( type->name );
+	ast::UnionInstType * mut = ast::mutate( type );
 	// It's not a semantic error if the union is not found, just an implicit forward declaration.
 	if ( decl ) {
 		// Just linking in the node.
-		auto mut = ast::mutate( type );
 		mut->base = decl;
-		type = mut;
 	}
 	if ( !decl || !decl->body ) {
-		auto mut = ast::mutate( type );
 		forwardUnions[ mut->name ].push_back( mut );
-		type = mut;
-	}
-	return type;
+	}
+	return mut;
 }
 
