Index: src/AST/Convert.cpp
===================================================================
--- src/AST/Convert.cpp	(revision 7b714027414b571c8984ce6a1be444c7cbe63bec)
+++ src/AST/Convert.cpp	(revision d4b37ab7ced315c944dd4895d790e996564f3d61)
@@ -168,4 +168,7 @@
 		auto attr = get<Attribute>().acceptL( node->attributes );
 
+		// This field can be unset very early on (Pre-FixReturnTypes).
+		auto newType = (type) ? type->clone() : nullptr;
+
 		auto decl = new ObjectDecl(
 			node->name,
@@ -173,5 +176,5 @@
 			LinkageSpec::Spec( node->linkage.val ),
 			bfwd,
-			type->clone(),
+			newType,
 			nullptr, // prevent infinite loop
 			attr,
@@ -1579,11 +1582,12 @@
 
 	virtual void visit( const ObjectDecl * old ) override final {
+		if ( inCache( old ) ) {
+			return;
+		}
 		auto&& type = GET_ACCEPT_1(type, Type);
 		auto&& init = GET_ACCEPT_1(init, Init);
 		auto&& bfwd = GET_ACCEPT_1(bitfieldWidth, Expr);
 		auto&& attr = GET_ACCEPT_V(attributes, Attribute);
-		if ( inCache( old ) ) {
-			return;
-		}
+
 		auto decl = new ast::ObjectDecl(
 			old->location,
Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision 7b714027414b571c8984ce6a1be444c7cbe63bec)
+++ src/AST/Decl.hpp	(revision d4b37ab7ced315c944dd4895d790e996564f3d61)
@@ -315,5 +315,5 @@
 
 	EnumDecl( const CodeLocation& loc, const std::string& name,
-		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,
+		std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type const * base = nullptr,
 		std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
 	: AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}
