Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/GenPoly/Box.cc	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -619,5 +619,5 @@
 			return 0;
 		}
-		
+
 		/// Returns T if the given declaration is a function with parameters (T*, T) for some TypeInstType T, NULL otherwise
 		TypeInstType *isTypeInstPtrValFn( DeclarationWithType *decl ) {
@@ -637,5 +637,5 @@
 			return 0;
 		}
-		
+
 		/// Returns T if the given declaration is (*?=?)(T *, T) for some TypeInstType T (return not checked, but maybe should be), NULL otherwise
 		TypeInstType *isTypeInstAssignment( DeclarationWithType *decl ) {
@@ -677,5 +677,5 @@
 			return 0;
 		}
-		
+
 		/// Returns T if the given declaration is a function with parameters (T*, T) for some type T, where neither parameter is cv-qualified,
 		/// NULL otherwise
@@ -772,5 +772,5 @@
 				copyOps.beginScope();
 				dtorOps.beginScope();
-				
+
 				DeclarationWithType *oldRetval = retval;
 				bool oldUseRetval = useRetval;
@@ -1471,7 +1471,9 @@
 		VariableExpr *wrapFunctionDecl( DeclarationWithType *functionDecl ) {
 			// line below cloned from FixFunction.cc
+			// xxx - functionObj is never added to a list of declarations...
 			ObjectDecl *functionObj = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClass(), functionDecl->get_linkage(), 0,
 			                                          new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0 );
 			functionObj->set_mangleName( functionDecl->get_mangleName() );
+			functionObj->set_scopeLevel( functionDecl->get_scopeLevel() );
 			return new VariableExpr( functionObj );
 		}
@@ -1492,5 +1494,5 @@
 					= ParamEntry( assertOp->get_uniqueId(), assertOp->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertOp ) );
 		}
-		
+
 		Statement * Pass1::mutate( ReturnStmt *returnStmt ) {
 			if ( retval && returnStmt->get_expr() ) {
@@ -1554,5 +1556,5 @@
 						DeclarationWithType *assertDtor = findOpForType( formalType, dtorOps, scopedDtorOps );
 						if ( ! assertDtor ) throw SemanticError( "No destructor found for ", formalType );
-						
+
 						// add inferred parameters for otype operators to assignment expression
 						// NOTE: Code here assumes that first four assertions are assign op, ctor, copy ctor, dtor, in that order
@@ -1568,8 +1570,5 @@
 						++actualIt;
 						addAssertionFor( assignExpr, *actualIt, assertDtor );
-						
-						//DeclarationWithType *actualDecl = asserts.front();
-						//assignExpr->get_inferParams()[ actualDecl->get_uniqueId() ]
-						//	= ParamEntry( assertAssign->get_uniqueId(), assertAssign->get_type()->clone(), actualDecl->get_type()->clone(), wrapFunctionDecl( assertAssign ) );
+
 					}
 				}
@@ -2181,5 +2180,5 @@
 		bool PolyGenericCalculator::findGeneric( Type *ty ) {
 			ty = replaceTypeInst( ty, env );
-			
+
 			if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( ty ) ) {
 				if ( scopeTyVars.find( typeInst->get_name() ) != scopeTyVars.end() ) {
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/SymTab/Validate.cc	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -541,7 +541,8 @@
 		if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) {
 			return new StructDecl( aggDecl->get_name() );
-//			return aggDecl->get_baseStruct();
 		} else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) {
 			return new UnionDecl( aggDecl->get_name() );
+		} else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) {
+			return new EnumDecl( enumDecl->get_name() );
 		} else {
 			return ret;
Index: src/examples/gc_no_raii/bug-repro/return_template.c
===================================================================
--- src/examples/gc_no_raii/bug-repro/return_template.c	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/bug-repro/return_template.c	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -5,6 +5,11 @@
 };
 
+forall(otype T) void ?{}(wrap(T)* this);
+forall(otype T) void ?{}(wrap(T)* this, wrap(T)* rhs);
+forall(otype T) void ^?{}(wrap(T)* this);
+forall(otype T) void ?=?(wrap(T)* this, wrap(T)* rhs);
+
 forall(otype T)
-static inline wrap(T) test()
+wrap(T) test()
 {
 	wrap(T) tester;
Index: src/examples/gc_no_raii/src/gc.h
===================================================================
--- src/examples/gc_no_raii/src/gc.h	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/gc.h	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -7,7 +7,9 @@
 static inline gcpointer(T) gcmalloc()
 {
-    gcpointer(T) test;
-    // ctor(&test, gc_allocate(sizeof(T)));
-    // gc_conditional_collect();
-    return test;
+    gcpointer(T) ptr;
+    void* address = gc_allocate(sizeof(T));
+    (&ptr){ address };
+    ctor(&ptr, address);
+    gc_conditional_collect();
+    return ptr;
 }
Index: src/examples/gc_no_raii/src/gcpointers.c
===================================================================
--- src/examples/gc_no_raii/src/gcpointers.c	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/gcpointers.c	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -1,5 +1,5 @@
 #include "gcpointers.h"
 
-#include "gc.h"
+// #include "gc.h"
 #include "internal/collector.h"
 #include "internal/object_header.h"
Index: src/examples/gc_no_raii/src/gcpointers.h
===================================================================
--- src/examples/gc_no_raii/src/gcpointers.h	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/gcpointers.h	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -10,9 +10,9 @@
 };
 
-void gcpointer_ctor(gcpointer_t* this);
-void gcpointer_ctor(gcpointer_t* this, void* address);
-void gcpointer_ctor(gcpointer_t* this, gcpointer_t* other);
-void gcpointer_dtor(gcpointer_t* this);
-gcpointer_t* gcpointer_assign(gcpointer_t* this, gcpointer_t* rhs);
+void ?{}(gcpointer_t* this);
+void ?{}(gcpointer_t* this, void* address);
+void ?{}(gcpointer_t* this, gcpointer_t other);
+void ^?{}(gcpointer_t* this);
+gcpointer_t* ?=?(gcpointer_t this, gcpointer_t rhs);
 
 //Logical operators
@@ -27,60 +27,16 @@
 };
 
-forall(otype T)
-static inline void ctor(gcpointer(T)* this)
-{
-	gcpointer_ctor(&this->internal);
-}
+//
+forall(otype T) void ?{}(gcpointer(T)* this);
+forall(otype T) void ?{}(gcpointer(T)* this, void* address);
+forall(otype T) void ctor(gcpointer(T)* this, void* address);
+forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T)* other);
+forall(otype T) void ^?{}(gcpointer(T)* this);
+forall(otype T) gcpointer(T) ?=?(gcpointer(T) this, gcpointer(T) rhs);
 
-// forall(otype T)
-// static inline void ctor(gcpointer(T)* this, int null)
-// {
-// 	gcpointer_ctor(&this->internal, NULL);
-// }
 
-forall(otype T)
-static inline void ctor(gcpointer(T)* this, void* address)
-{
-	gcpointer_ctor(&this->internal, address);
-}
-
-forall(otype T)
-static inline void ctor(gcpointer(T)* this, gcpointer(T)* other)
-{
-	gcpointer_ctor(&this->internal, other);
-}
-
-forall(otype T)
-static inline void dtor(gcpointer(T)* this)
-{
-	gcpointer_dtor(&this->internal);
-}
-
-forall(otype T)
-static inline gcpointer(T)* ?=?(gcpointer(T)* this, gcpointer(T)* rhs)
-{
-	gcpointer_assign(&this->internal, &rhs->internal);
-	return this;
-}
-
-forall(otype T)
-static inline T *?(gcpointer(T) this)
-{
-	return *(T*)this.internal.ptr;
-}
+forall(otype T) T *?(gcpointer(T) this);
 
 //Logical operators
-forall(otype T)
-static inline int ?!=?(gcpointer(T) this, gcpointer(T) rhs)
-{
-	return this.internal.ptr != rhs.internal.ptr;
-}
-
-forall(otype T)
-static inline int ?==?(gcpointer(T) this, gcpointer(T) rhs)
-{
-	return !(this == rhs);
-}
-
-forall(otype T)
-extern struct gcpointer(T) 0;
+forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
+forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
Index: src/examples/gc_no_raii/src/internal/memory_pool.h
===================================================================
--- src/examples/gc_no_raii/src/internal/memory_pool.h	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/internal/memory_pool.h	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -3,4 +3,5 @@
 extern "C" {
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdint.h>
 }
Index: src/examples/gc_no_raii/src/internal/state.h
===================================================================
--- src/examples/gc_no_raii/src/internal/state.h	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/internal/state.h	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -1,9 +1,15 @@
 #pragma once
 
+#ifdef __cforall
+extern "C" {
+#endif
 #include <stddef.h>
 #include <stdint.h>
+#ifdef __cforall
+}
+#endif
+#include <vector>
 
 #include "tools.h"
-#include "vector.h"
 
 typedef vector(struct gc_memory_pool*, heap_allocator(struct gc_memory_pool*)) pools_table_t;
Index: src/examples/gc_no_raii/src/tools/worklist.h
===================================================================
--- src/examples/gc_no_raii/src/tools/worklist.h	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/src/tools/worklist.h	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -10,5 +10,5 @@
 #endif
 
-#include "vector.h"
+#include <vector>
 
 typedef vector(intptr_t*, heap_allocator(intptr_t*)) worklist_t;
Index: src/examples/gc_no_raii/test/badlll.c
===================================================================
--- src/examples/gc_no_raii/test/badlll.c	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/test/badlll.c	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -7,46 +7,50 @@
 };
 
+void ?{}(List_t* this);
+List_t* ?=?(List_t* this, List_t* rhs);
+
 typedef gcpointer(List_t) LLL;
 
 #define MAX (1024 * 1024)
 
-LLL buildLLL(int sz)
+// LLL buildLLL(int sz)
+void bla()
 {
 	int i;
-	LLL ll0, lll, llc;
-
-	ll0 = gcmalloc();
-	ll0->val = 0;
-	lll = ll0;
-
-	for (i = 1; i < sz; i++)
-	{
-		llc = gcmalloc();
-		llc->val = i;
-		lll->next = llc;
-		lll = llc;
-	}
-
-	return ll0;
+	// LLL ll0;//, lll, llc;
+//
+// 	ll0 = gcmalloc();
+// 	ll0->val = 0;
+// 	lll = ll0;
+//
+// 	for (i = 1; i < sz; i++)
+// 	{
+// 		llc = gcmalloc();
+// 		llc->val = i;
+// 		lll->next = llc;
+// 		lll = llc;
+// 	}
+//
+	// return ll0;
 }
-
-void testLLL(LLL lll)
-{
-	unsigned char *counted;
-
-	counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
-	while (lll)
-	{
-		counted[lll->val]++;
-		if (counted[lll->val] > 1)
-		{
-			fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
-			exit(1);
-		}
-		lll = lll->next;
-	}
-
-	return;
-}
+//
+// void testLLL(LLL lll)
+// {
+// 	unsigned char *counted;
+//
+// 	counted = (unsigned char *) calloc(MAX, sizeof(unsigned char));
+// 	while (lll)
+// 	{
+// 		counted[lll->val]++;
+// 		if (counted[lll->val] > 1)
+// 		{
+// 			fprintf(stderr, "ERROR! Encountered %d twice!\n", lll->val);
+// 			exit(1);
+// 		}
+// 		lll = lll->next;
+// 	}
+//
+// 	return;
+// }
 
 int main(void)
@@ -54,7 +58,7 @@
 	LLL mylll;
 
-	mylll = buildLLL(MAX);
-
-	testLLL(mylll);
+	// mylll = buildLLL(MAX);
+	//
+	// testLLL(mylll);
 
 	return 0;
Index: src/examples/gc_no_raii/test/gctest.c
===================================================================
--- src/examples/gc_no_raii/test/gctest.c	(revision 8688ce11a6b7047ca103783a09a35cbcf0be3233)
+++ src/examples/gc_no_raii/test/gctest.c	(revision 76e8c55c6d650ecf639cf8cc657c2c1c0b2bfb3c)
@@ -7,3 +7,5 @@
 int main() {
 	sout | "Bonjour au monde!\n";
+
+	gcpointer(int) anInt = gcmalloc();
 }
