Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 6f950007fd85cf2f04928840823d690ed9c9d98b)
+++ src/ResolvExpr/Resolver.cc	(revision 395fc378ab2a1e951811ea084320ee6ea6f95015)
@@ -240,4 +240,16 @@
 		functionReturn = ResolvExpr::extractResultType( functionDecl->get_functionType() );
 		Parent::visit( functionDecl );
+
+		// default value expressions have an environment which shouldn't be there and trips up later passes.
+		// xxx - it might be necessary to somehow keep the information from this environment, but I can't currently
+		// see how it's useful.
+		for ( Declaration * d : functionDecl->get_functionType()->get_parameters() ) {
+			if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( d ) ) {
+				if ( SingleInit * init = dynamic_cast< SingleInit * >( obj->get_init() ) ) {
+					delete init->get_value()->get_env();
+					init->get_value()->set_env( nullptr );
+				}
+			}
+		}
 	}
 
