Index: src/Validate/LinkReferenceToTypes.cpp
===================================================================
--- src/Validate/LinkReferenceToTypes.cpp	(revision 97b47ec7c9e76ee0d19dd0eb42627cd603ebae00)
+++ src/Validate/LinkReferenceToTypes.cpp	(revision bef224516892e07bf860916060c1f2ca5b6870e0)
@@ -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;
 }
 
