Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision 300fbeede5a76d3fd0340e622ef800b6dc26dc73)
+++ src/AST/Decl.hpp	(revision 7c608d567ea84ab4e1079f9c59749f9c8bce0179)
@@ -103,7 +103,7 @@
 
 	ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type, 
-		Init * init = nullptr, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C, 
-		Expr * bitWd = nullptr, std::vector< ptr<Attribute> > && attrs = {}, 
-		Function::Specs fs = {} )
+		const Init * init = nullptr, Storage::Classes storage = {}, 
+		Linkage::Spec linkage = Linkage::C, const Expr * bitWd = nullptr, 
+		std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} )
 	: DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ),
 	  init( init ), bitfieldWidth( bitWd ) {}
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 300fbeede5a76d3fd0340e622ef800b6dc26dc73)
+++ src/ResolvExpr/Resolver.cc	(revision 7c608d567ea84ab4e1079f9c59749f9c8bce0179)
@@ -27,4 +27,6 @@
 #include "typeops.h"                     // for extractResultType
 #include "Unify.h"                       // for unify
+#include "AST/Decl.hpp"
+#include "AST/Init.hpp"
 #include "AST/Pass.hpp"
 #include "AST/SymbolTable.hpp"
@@ -941,35 +943,39 @@
 	  public ast::WithVisitorRef<Resolver_new>, public ast::WithShortCircuiting, 
 	  public ast::WithStmtsToAdd<> {
-		  
+	
+		ast::ptr< ast::Type > functionReturn = nullptr;
+		// ast::CurrentObject currentObject = nullptr;
+		// bool inEnumDecl = false;
+
 	public: 
 		Resolver_new() = default;
 		Resolver_new( const ast::SymbolTable & syms ) { symtab = syms; }
 
-		void previsit( ast::FunctionDecl * functionDecl );
-		ast::DeclWithType * postvisit( ast::FunctionDecl * functionDecl );
-		void previsit( ast::ObjectDecl * objectDecl );
-		void previsit( ast::EnumDecl * enumDecl );
-		void previsit( ast::StaticAssertDecl * assertDecl );
-
-		void previsit( ast::ArrayType * at );
-		void previsit( ast::PointerType * pt );
-
-		void previsit( ast::ExprStmt * exprStmt );
-		void previsit( ast::AsmExpr * asmExpr );
-		void previsit( ast::AsmStmt * asmStmt );
-		void previsit( ast::IfStmt * ifStmt );
-		void previsit( ast::WhileStmt * whileStmt );
-		void previsit( ast::ForStmt * forStmt );
-		void previsit( ast::SwitchStmt * switchStmt );
-		void previsit( ast::CaseStmt * caseStmt );
-		void previsit( ast::BranchStmt * branchStmt );
-		void previsit( ast::ReturnStmt * returnStmt );
-		void previsit( ast::ThrowStmt * throwStmt );
-		void previsit( ast::CatchStmt * catchStmt );
-		void previsit( ast::WaitForStmt * stmt );
-
-		void previsit( ast::SingleInit * singleInit );
-		void previsit( ast::ListInit * listInit );
-		void previsit( ast::ConstructorInit * ctorInit );
+		void previsit( const ast::FunctionDecl * functionDecl );
+		const ast::FunctionDecl * postvisit( const ast::FunctionDecl * functionDecl );
+		void previsit( const ast::ObjectDecl * objectDecl );
+		void previsit( const ast::EnumDecl * enumDecl );
+		void previsit( const ast::StaticAssertDecl * assertDecl );
+
+		void previsit( const ast::ArrayType * at );
+		void previsit( const ast::PointerType * pt );
+
+		void previsit( const ast::ExprStmt * exprStmt );
+		void previsit( const ast::AsmExpr * asmExpr );
+		void previsit( const ast::AsmStmt * asmStmt );
+		void previsit( const ast::IfStmt * ifStmt );
+		void previsit( const ast::WhileStmt * whileStmt );
+		void previsit( const ast::ForStmt * forStmt );
+		void previsit( const ast::SwitchStmt * switchStmt );
+		void previsit( const ast::CaseStmt * caseStmt );
+		void previsit( const ast::BranchStmt * branchStmt );
+		void previsit( const ast::ReturnStmt * returnStmt );
+		void previsit( const ast::ThrowStmt * throwStmt );
+		void previsit( const ast::CatchStmt * catchStmt );
+		void previsit( const ast::WaitForStmt * stmt );
+
+		void previsit( const ast::SingleInit * singleInit );
+		void previsit( const ast::ListInit * listInit );
+		void previsit( const ast::ConstructorInit * ctorInit );
 	};
 
@@ -979,18 +985,32 @@
 	}
 
-	void previsit( ast::FunctionDecl * functionDecl ) {
-		#warning unimplemented; Resolver port in progress
-		(void)functionDecl;
-		assert(false);
-	}
-
-	ast::DeclWithType * postvisit( ast::FunctionDecl * functionDecl ) {
-		#warning unimplemented; Resolver port in progress
-		(void)functionDecl;
-		assert(false);
-		return nullptr;
-	}
-
-	void previsit( ast::ObjectDecl * objectDecl ) {
+	void Resolver_new::previsit( const ast::FunctionDecl * functionDecl ) {
+		GuardValue( functionReturn );
+		functionReturn = extractResultType( functionDecl->type );
+	}
+
+	const ast::FunctionDecl * Resolver_new::postvisit( const ast::FunctionDecl * functionDecl ) {
+		// default value expressions have an environment which shouldn't be there and trips up 
+		// later passes.
+		ast::ptr< ast::FunctionDecl > ret = functionDecl;
+		for ( unsigned i = 0; i < functionDecl->type->params.size(); ++i ) {
+			const ast::ptr<ast::DeclWithType> & d = functionDecl->type->params[i];
+			
+			if ( const ast::ObjectDecl * obj = d.as< ast::ObjectDecl >() ) {
+				if ( const ast::SingleInit * init = obj->init.as< ast::SingleInit >() ) {
+					if ( init->value->env == nullptr ) continue;
+					// clone initializer minus the initializer environment
+					strict_dynamic_cast< ast::SingleInit * >(
+						strict_dynamic_cast< ast::ObjectDecl * >( 
+							ret.get_and_mutate()->type.get_and_mutate()->params[i].get_and_mutate()
+						)->init.get_and_mutate()
+					)->value.get_and_mutate()->env = nullptr;
+				}
+			}
+		}
+		return ret.get();
+	}
+
+	void Resolver_new::previsit( const ast::ObjectDecl * objectDecl ) {
 		#warning unimplemented; Resolver port in progress
 		(void)objectDecl;
@@ -998,5 +1018,5 @@
 	}
 
-	void previsit( ast::EnumDecl * enumDecl ) {
+	void Resolver_new::previsit( const ast::EnumDecl * enumDecl ) {
 		#warning unimplemented; Resolver port in progress
 		(void)enumDecl;
@@ -1004,5 +1024,5 @@
 	}
 
-	void previsit( ast::StaticAssertDecl * assertDecl ) {
+	void Resolver_new::previsit( const ast::StaticAssertDecl * assertDecl ) {
 		#warning unimplemented; Resolver port in progress
 		(void)assertDecl;
@@ -1010,5 +1030,5 @@
 	}
 
-	void previsit( ast::ArrayType * at ) {
+	void Resolver_new::previsit( const ast::ArrayType * at ) {
 		#warning unimplemented; Resolver port in progress
 		(void)at;
@@ -1016,5 +1036,5 @@
 	}
 
-	void previsit( ast::PointerType * pt ) {
+	void Resolver_new::previsit( const ast::PointerType * pt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)pt;
@@ -1022,5 +1042,5 @@
 	}
 
-	void previsit( ast::ExprStmt * exprStmt ) {
+	void Resolver_new::previsit( const ast::ExprStmt * exprStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)exprStmt;
@@ -1028,5 +1048,5 @@
 	}
 
-	void previsit( ast::AsmExpr * asmExpr ) {
+	void Resolver_new::previsit( const ast::AsmExpr * asmExpr ) {
 		#warning unimplemented; Resolver port in progress
 		(void)asmExpr;
@@ -1034,5 +1054,5 @@
 	}
 
-	void previsit( ast::AsmStmt * asmStmt ) {
+	void Resolver_new::previsit( const ast::AsmStmt * asmStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)asmStmt;
@@ -1040,5 +1060,5 @@
 	}
 
-	void previsit( ast::IfStmt * ifStmt ) {
+	void Resolver_new::previsit( const ast::IfStmt * ifStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)ifStmt;
@@ -1046,5 +1066,5 @@
 	}
 
-	void previsit( ast::WhileStmt * whileStmt ) {
+	void Resolver_new::previsit( const ast::WhileStmt * whileStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)whileStmt;
@@ -1052,5 +1072,5 @@
 	}
 
-	void previsit( ast::ForStmt * forStmt ) {
+	void Resolver_new::previsit( const ast::ForStmt * forStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)forStmt;
@@ -1058,5 +1078,5 @@
 	}
 
-	void previsit( ast::SwitchStmt * switchStmt ) {
+	void Resolver_new::previsit( const ast::SwitchStmt * switchStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)switchStmt;
@@ -1064,5 +1084,5 @@
 	}
 
-	void previsit( ast::CaseStmt * caseStmt ) {
+	void Resolver_new::previsit( const ast::CaseStmt * caseStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)caseStmt;
@@ -1070,5 +1090,5 @@
 	}
 
-	void previsit( ast::BranchStmt * branchStmt ) {
+	void Resolver_new::previsit( const ast::BranchStmt * branchStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)branchStmt;
@@ -1076,5 +1096,5 @@
 	}
 
-	void previsit( ast::ReturnStmt * returnStmt ) {
+	void Resolver_new::previsit( const ast::ReturnStmt * returnStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)returnStmt;
@@ -1082,5 +1102,5 @@
 	}
 
-	void previsit( ast::ThrowStmt * throwStmt ) {
+	void Resolver_new::previsit( const ast::ThrowStmt * throwStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)throwStmt;
@@ -1088,5 +1108,5 @@
 	}
 
-	void previsit( ast::CatchStmt * catchStmt ) {
+	void Resolver_new::previsit( const ast::CatchStmt * catchStmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)catchStmt;
@@ -1094,5 +1114,5 @@
 	}
 
-	void previsit( ast::WaitForStmt * stmt ) {
+	void Resolver_new::previsit( const ast::WaitForStmt * stmt ) {
 		#warning unimplemented; Resolver port in progress
 		(void)stmt;
@@ -1100,5 +1120,5 @@
 	}
 
-	void previsit( ast::SingleInit * singleInit ) {
+	void Resolver_new::previsit( const ast::SingleInit * singleInit ) {
 		#warning unimplemented; Resolver port in progress
 		(void)singleInit;
@@ -1106,5 +1126,5 @@
 	}
 
-	void previsit( ast::ListInit * listInit ) {
+	void Resolver_new::previsit( const ast::ListInit * listInit ) {
 		#warning unimplemented; Resolver port in progress
 		(void)listInit;
@@ -1112,5 +1132,5 @@
 	}
 
-	void previsit( ast::ConstructorInit * ctorInit ) {
+	void Resolver_new::previsit( const ast::ConstructorInit * ctorInit ) {
 		#warning unimplemented; Resolver port in progress
 		(void)ctorInit;
