Index: src/SynTree/ReferenceToType.cc
===================================================================
--- src/SynTree/ReferenceToType.cc	(revision 61255ad0ca09164c5b6b5904a6653569a4380074)
+++ src/SynTree/ReferenceToType.cc	(revision 81644e025cbf854af3550d54b343f22ec9ec8f05)
@@ -70,4 +70,6 @@
 bool StructInstType::isComplete() const { return baseStruct ? baseStruct->has_body() : false; }
 
+AggregateDecl * StructInstType::getAggr() { return baseStruct; }
+
 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
 	assert( baseStruct );
@@ -101,4 +103,6 @@
 
 bool UnionInstType::isComplete() const { return baseUnion ? baseUnion->has_body() : false; }
+
+AggregateDecl * UnionInstType::getAggr() { return baseUnion; }
 
 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 61255ad0ca09164c5b6b5904a6653569a4380074)
+++ src/SynTree/Type.h	(revision 81644e025cbf854af3550d54b343f22ec9ec8f05)
@@ -178,4 +178,6 @@
 	virtual bool isComplete() const { return true; }
 
+	virtual AggregateDecl * getAggr() {	assertf( false, "Non-aggregate type: %s", toString( this ).c_str() ); }
+
 	virtual Type *clone() const = 0;
 	virtual void accept( Visitor & v ) = 0;
@@ -405,4 +407,6 @@
 	virtual bool isComplete() const override;
 
+	virtual AggregateDecl * getAggr() override;
+
 	/// Looks up the members of this struct named "name" and places them into "foundDecls".
 	/// Clones declarations into "foundDecls", caller responsible for freeing
@@ -436,4 +440,6 @@
 
 	virtual bool isComplete() const override;
+
+	virtual AggregateDecl * getAggr() override;
 
 	/// looks up the members of this union named "name" and places them into "foundDecls"
