Index: nkinsfile
===================================================================
--- Jenkinsfile	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ 	(revision )
@@ -1,465 +1,0 @@
-#!groovy
-
-import groovy.transform.Field
-
-//===========================================================================================================
-// Main loop of the compilation
-//===========================================================================================================
-
-node('master') {
-	// Globals
-	BuildDir  = pwd tmp: true
-	SrcDir    = pwd tmp: false
-	Settings  = null
-	StageName = ''
-
-	// Local variables
-	def err = null
-	def log_needed = false
-
-	currentBuild.result = "SUCCESS"
-
-	try {
-		//Wrap build to add timestamp to command line
-		wrap([$class: 'TimestamperBuildWrapper']) {
-
-			Settings = prepare_build()
-
-			node(Settings.Architecture.node) {
-				BuildDir  = pwd tmp: true
-				SrcDir    = pwd tmp: false
-
-				clean()
-
-				checkout()
-
-				build()
-
-				test()
-
-				benchmark()
-
-				build_doc()
-
-				publish()
-			}
-
-			// Update the build directories when exiting the node
-			BuildDir  = pwd tmp: true
-			SrcDir    = pwd tmp: false
-		}
-	}
-
-	//If an exception is caught we need to change the status and remember to
-	//attach the build log to the email
-	catch (Exception caughtError) {
-		//rethrow error later
-		err = caughtError
-
-		echo err.toString()
-
-		//An error has occured, the build log is relevent
-		log_needed = true
-
-		//Store the result of the build log
-		currentBuild.result = "${StageName} FAILURE".trim()
-	}
-
-	finally {
-		//Send email with final results if this is not a full build
-		email(log_needed)
-
-		echo 'Build Completed'
-
-		/* Must re-throw exception to propagate error */
-		if (err) {
-			throw err
-		}
-	}
-}
-//===========================================================================================================
-// Main compilation routines
-//===========================================================================================================
-def clean() {
-	build_stage('Cleanup') {
-		// clean the build by wipping the build directory
-		dir(BuildDir) {
-			deleteDir()
-		}
-	}
-}
-
-//Compilation script is done here but environnement set-up and error handling is done in main loop
-def checkout() {
-	build_stage('Checkout') {
-		//checkout the source code and clean the repo
-		final scmVars = checkout scm
-		Settings.GitNewRef = scmVars.GIT_COMMIT
-		Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT
-
-		echo GitLogMessage()
-	}
-}
-
-def build() {
-	build_stage('Build') {
-		// Build outside of the src tree to ease cleaning
-		dir (BuildDir) {
-			//Configure the conpilation (Output is not relevant)
-			//Use the current directory as the installation target so nothing escapes the sandbox
-			//Also specify the compiler by hand
-			targets=""
-			if( Settings.RunAllTests || Settings.RunBenchmark ) {
-				targets="--with-target-hosts='host:debug,host:nodebug'"
-			} else {
-				targets="--with-target-hosts='host:debug'"
-			}
-
-			sh "${SrcDir}/configure CXX=${Settings.Compiler.CXX} CC=${Settings.Compiler.CC} ${Settings.Architecture.flags} ${targets} --quiet"
-
-			//Compile the project
-			sh 'make -j 8 --no-print-directory'
-		}
-	}
-}
-
-def test() {
-	build_stage('Test') {
-
-		dir (BuildDir) {
-			//Run the tests from the tests directory
-			if ( Settings.RunAllTests ) {
-				sh 'make --no-print-directory -C tests timeouts="--timeout=1200" all-tests debug=yes'
-				sh 'make --no-print-directory -C tests timeouts="--timeout=1200" all-tests debug=no '
-			}
-			else {
-				sh 'make --no-print-directory -C tests'
-			}
-		}
-	}
-}
-
-def benchmark() {
-	build_stage('Benchmark') {
-
-		if( !Settings.RunBenchmark ) return
-
-		dir (BuildDir) {
-			//Append bench results
-			sh "make --no-print-directory -C benchmark jenkins"
-		}
-	}
-}
-
-def build_doc() {
-	build_stage('Documentation') {
-
-		if( !Settings.BuildDocumentation ) return
-
-		dir ('doc/user') {
-			make_doc()
-		}
-
-		dir ('doc/refrat') {
-			make_doc()
-		}
-	}
-}
-
-def publish() {
-	build_stage('Publish') {
-
-		if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' }
-
-		def groupCompile = new PlotGroup('Compilation', 'seconds', true)
-		def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false)
-
-		//Then publish the results
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'compile'  , groupCompile    , 'Compilation')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch', groupConcurrency, 'Context Switching')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex'    , groupConcurrency, 'Mutual Exclusion')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'signal'   , groupConcurrency, 'Internal and External Scheduling')
-	}
-}
-
-//===========================================================================================================
-//Routine responsible of sending the email notification once the build is completed
-//===========================================================================================================
-def GitLogMessage() {
-	if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n"
-
-	sh "${SrcDir}/tools/PrettyGitLogs.sh ${SrcDir} ${BuildDir} ${Settings.GitOldRef} ${Settings.GitNewRef}"
-
-	def gitUpdate = readFile("${BuildDir}/GIT_UPDATE")
-	def gitLog    = readFile("${BuildDir}/GIT_LOG")
-	def gitDiff   = readFile("${BuildDir}/GIT_DIFF")
-
-	return """
-<pre>
-The branch ${env.BRANCH_NAME} has been updated.
-${gitUpdate}
-</pre>
-
-<p>Check console output at ${env.BUILD_URL} to view the results.</p>
-
-<p>- Status --------------------------------------------------------------</p>
-
-<p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
-
-<p>- Log -----------------------------------------------------------------</p>
-
-<pre>
-${gitLog}
-</pre>
-
-<p>-----------------------------------------------------------------------</p>
-<pre>
-Summary of changes:
-${gitDiff}
-</pre>
-"""
-}
-
-//Standard build email notification
-def email(boolean log) {
-	//Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
-	//Configurations for email format
-	echo 'Notifying users of result'
-
-	def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
-	def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
-	def email_body = """<p>This is an automated email from the Jenkins build machine. It was
-generated because of a git hooks/post-receive script following
-a ref change which was pushed to the C\u2200 repository.</p>
-""" + GitLogMessage()
-
-	def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
-
-	if( Settings && !Settings.Silent ) {
-		//send email notification
-		emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
-	} else {
-		echo "Would send email to: ${email_to}"
-		echo "With title: ${email_subject}"
-		echo "Content: \n${email_body}"
-	}
-}
-
-//===========================================================================================================
-// Helper classes/variables/routines
-//===========================================================================================================
-//Description of a compiler (Must be serializable since pipelines are persistent)
-class CC_Desc implements Serializable {
-	public String name
-	public String CXX
-	public String CC
-
-	CC_Desc(String name, String CXX, String CC) {
-		this.name = name
-		this.CXX = CXX
-		this.CC = CC
-	}
-}
-
-//Description of an architecture (Must be serializable since pipelines are persistent)
-class Arch_Desc implements Serializable {
-	public String name
-	public String flags
-	public String node
-
-	Arch_Desc(String name, String flags, String node) {
-		this.name  = name
-		this.flags = flags
-		this.node  = node
-	}
-}
-
-class BuildSettings implements Serializable {
-	public final CC_Desc Compiler
-	public final Arch_Desc Architecture
-	public final Boolean RunAllTests
-	public final Boolean RunBenchmark
-	public final Boolean BuildDocumentation
-	public final Boolean Publish
-	public final Boolean Silent
-	public final Boolean IsSandbox
-	public final String DescLong
-	public final String DescShort
-
-	public String GitNewRef
-	public String GitOldRef
-
-	BuildSettings(java.util.Collections$UnmodifiableMap param, String branch) {
-		switch( param.Compiler ) {
-			case 'gcc-6':
-				this.Compiler = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
-			break
-			case 'gcc-5':
-				this.Compiler = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
-			break
-			case 'gcc-4.9':
-				this.Compiler = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
-			break
-			case 'clang':
-				this.Compiler = new CC_Desc('clang', 'clang++', 'gcc-6')
-			break
-			default :
-				error "Unhandled compiler : ${cc}"
-		}
-
-		switch( param.Architecture ) {
-			case 'x64':
-				this.Architecture = new Arch_Desc('x64', '--host=x86_64', 'x64')
-			break
-			case 'x86':
-				this.Architecture = new Arch_Desc('x86', '--host=i386', 'x86')
-			break
-			default :
-				error "Unhandled architecture : ${arch}"
-		}
-
-		this.IsSandbox          = (branch == "jenkins-sandbox")
-		this.RunAllTests        = param.RunAllTests
-		this.RunBenchmark       = param.RunBenchmark
-		this.BuildDocumentation = param.BuildDocumentation
-		this.Publish            = param.Publish
-		this.Silent             = param.Silent
-
-		def full = param.RunAllTests ? " (Full)" : ""
-		this.DescShort = "${ this.Compiler.name }:${ this.Architecture.name }${full}"
-
-		this.DescLong = """Compiler 	         : ${ this.Compiler.name } (${ this.Compiler.CXX }/${ this.Compiler.CC })
-Architecture            : ${ this.Architecture.name }
-Arc Flags               : ${ this.Architecture.flags }
-Run All Tests           : ${ this.RunAllTests.toString() }
-Run Benchmark           : ${ this.RunBenchmark.toString() }
-Build Documentation     : ${ this.BuildDocumentation.toString() }
-Publish                 : ${ this.Publish.toString() }
-Silent                  : ${ this.Silent.toString() }
-"""
-
-		this.GitNewRef = ''
-		this.GitOldRef = ''
-	}
-}
-
-class PlotGroup implements Serializable {
-	public String name
-	public String unit
-	public boolean log
-
-	PlotGroup(String name, String unit, boolean log) {
-		this.name = name
-		this.unit = unit
-		this.log = log
-	}
-}
-
-def prepare_build() {
-	// prepare the properties
-	properties ([ 													\
-		[$class: 'ParametersDefinitionProperty', 								\
-			parameterDefinitions: [ 									\
-				[$class: 'ChoiceParameterDefinition',						\
-					description: 'Which compiler to use',					\
-					name: 'Compiler',									\
-					choices: 'gcc-6\ngcc-5\ngcc-4.9\nclang',					\
-					defaultValue: 'gcc-6',								\
-				],												\
-				[$class: 'ChoiceParameterDefinition',						\
-					description: 'The target architecture',					\
-					name: 'Architecture',								\
-					choices: 'x64\nx86',								\
-					defaultValue: 'x64',								\
-				],												\
-				[$class: 'BooleanParameterDefinition',  						\
-					description: 'If false, only the quick test suite is ran', 		\
-					name: 'RunAllTests', 								\
-					defaultValue: false,  								\
-				], 												\
-				[$class: 'BooleanParameterDefinition',  						\
-					description: 'If true, jenkins also runs benchmarks', 		\
-					name: 'RunBenchmark', 								\
-					defaultValue: false,  								\
-				], 												\
-				[$class: 'BooleanParameterDefinition',  						\
-					description: 'If true, jenkins also builds documentation', 		\
-					name: 'BuildDocumentation', 							\
-					defaultValue: true,  								\
-				],												\
-				[$class: 'BooleanParameterDefinition',  						\
-					description: 'If true, jenkins also publishes results', 		\
-					name: 'Publish', 									\
-					defaultValue: false,  								\
-				],												\
-				[$class: 'BooleanParameterDefinition',  						\
-					description: 'If true, jenkins will not send emails', 		\
-					name: 'Silent', 									\
-					defaultValue: false,  								\
-				],												\
-			],
-		]])
-
-	// It's unfortunate but it looks like we need to checkout the entire repo just to get the pretty git printer
-	checkout scm
-
-	final settings = new BuildSettings(params, env.BRANCH_NAME)
-
-	currentBuild.description = settings.DescShort
-	echo                       settings.DescLong
-
-	return settings
-}
-
-def build_stage(String name, Closure block ) {
-	StageName = name
-	echo " -------- ${StageName} -------- "
-	stage(name, block)
-}
-
-def make_doc() {
-	def err = null
-	try {
-		sh 'make clean > /dev/null'
-		sh 'make > /dev/null 2>&1'
-	}
-	catch (Exception caughtError) {
-		err = caughtError //rethrow error later
-		sh 'cat build/*.log'
-	}
-	finally {
-		if (err) throw err // Must re-throw exception to propagate error
-	}
-}
-
-def do_plot(boolean new_data, String file, PlotGroup group, String title) {
-
-	if(new_data) {
-		echo "Publishing new data"
-	}
-
-	def series = new_data ? [[
-				file: "${file}.csv",
-				exclusionValues: '',
-				displayTableFlag: false,
-				inclusionFlag: 'OFF',
-				url: ''
-			]] : [];
-
-	echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}"
-	dir("${BuildDir}/benchmark/") {
-		plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv",
-			csvSeries: series,
-			group: "${group.name}",
-			title: "${title}",
-			style: 'lineSimple',
-			exclZero: false,
-			keepRecords: false,
-			logarithmic: group.log,
-			numBuilds: '120',
-			useDescr: true,
-			yaxis: group.unit,
-			yaxisMaximum: '',
-			yaxisMinimum: ''
-	}
-}
Index: src/AST/Node.cpp
===================================================================
--- src/AST/Node.cpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/AST/Node.cpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -17,4 +17,5 @@
 #include "Fwd.hpp"
 
+#include <csignal>  // MEMORY DEBUG -- for raise
 #include <iostream>
 
@@ -28,4 +29,17 @@
 
 #include "Print.hpp"
+
+/// MEMORY DEBUG -- allows breaking on construction/destruction of dynamically chosen object.
+/// Process to use in GDB:
+///   break ast::Node::_trap()
+///   run
+///   set variable MEM_TRAP_OBJ = <target>
+///   disable <first breakpoint>
+///   continue
+void * MEM_TRAP_OBJ = nullptr;
+
+void ast::Node::_trap() {
+	if ( this == MEM_TRAP_OBJ ) std::raise(SIGTRAP);
+}
 
 template< typename node_t, enum ast::Node::ref_type ref_t >
Index: src/AST/Node.hpp
===================================================================
--- src/AST/Node.hpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/AST/Node.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -30,13 +30,15 @@
 /// Keeps both strong and weak reference counts.
 class Node {
+	/// call to debug on node creation/deletion
+	void _trap();
 public:
 	// override defaults to ensure assignment doesn't
 	// change/share reference counts
-	Node() = default;
-	Node(const Node&) : strong_count(0), weak_count(0) {}
-	Node(Node&&) : strong_count(0), weak_count(0) {}
+	Node() { _trap(); }
+	Node(const Node&) : strong_count(0), weak_count(0) { _trap(); }
+	Node(Node&&) : strong_count(0), weak_count(0) { _trap(); }
 	Node& operator= (const Node&) = delete;
 	Node& operator= (Node&&) = delete;
-	virtual ~Node() = default;
+	virtual ~Node() { _trap(); }
 
 	virtual const Node * accept( Visitor & v ) const = 0;
Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/AST/Pass.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -209,6 +209,6 @@
 	/// Internal RAII guard for symbol table features
 	struct guard_symtab {
-		guard_symtab( Pass<pass_t> & pass ): pass( pass ) { __pass::symtab::enter(pass, 0); }
-		~guard_symtab()                                   { __pass::symtab::leave(pass, 0); }
+		guard_symtab( Pass<pass_t> & pass ): pass( pass ) { __pass::symtab::enter(pass.pass, 0); }
+		~guard_symtab()                                   { __pass::symtab::leave(pass.pass, 0); }
 		Pass<pass_t> & pass;
 	};
@@ -216,6 +216,6 @@
 	/// Internal RAII guard for scope features
 	struct guard_scope {
-		guard_scope( Pass<pass_t> & pass ): pass( pass ) { __pass::scope::enter(pass, 0); }
-		~guard_scope()                                   { __pass::scope::leave(pass, 0); }
+		guard_scope( Pass<pass_t> & pass ): pass( pass ) { __pass::scope::enter(pass.pass, 0); }
+		~guard_scope()                                   { __pass::scope::leave(pass.pass, 0); }
 		Pass<pass_t> & pass;
 	};
Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/AST/Pass.impl.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -429,12 +429,12 @@
 			guard_symtab guard { *this };
 			// implicit add __func__ identifier as specified in the C manual 6.4.2.2
-			static ast::ObjectDecl func(
-				node->location, "__func__",
-				new ast::ArrayType(
-					new ast::BasicType( ast::BasicType::Char, ast::CV::Qualifiers( ast::CV::Const ) ),
+			static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{ 
+				CodeLocation{}, "__func__",
+				new ast::ArrayType{
+					new ast::BasicType{ ast::BasicType::Char, ast::CV::Const },
 					nullptr, VariableLen, DynamicDim
-				)
-			);
-			__pass::symtab::addId( pass, 0, &func );
+				}
+			} };
+			__pass::symtab::addId( pass, 0, func );
 			VISIT(
 				maybe_accept( node, &FunctionDecl::type );
@@ -610,8 +610,8 @@
 	VISIT({
 		// do not enter a new scope if inFunction is true - needs to check old state before the assignment
-		auto guard1 = makeFuncGuard( [this, inFunction = this->inFunction]() {
-			if ( ! inFunction ) __pass::symtab::enter(pass, 0);
-		}, [this, inFunction = this->inFunction]() {
-			if ( ! inFunction ) __pass::symtab::leave(pass, 0);
+		auto guard1 = makeFuncGuard( [this, inFunctionCpy = this->inFunction]() {
+			if ( ! inFunctionCpy ) __pass::symtab::enter(pass, 0);
+		}, [this, inFunctionCpy = this->inFunction]() {
+			if ( ! inFunctionCpy ) __pass::symtab::leave(pass, 0);
 		});
 		ValueGuard< bool > guard2( inFunction );
Index: src/AST/Pass.proto.hpp
===================================================================
--- src/AST/Pass.proto.hpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/AST/Pass.proto.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -270,5 +270,5 @@
 		// Some simple scoping rules
 		template<typename pass_t>
-		static inline auto enter( pass_t & pass, int ) -> decltype( pass.symtab.enterScope(), void() ) {
+		static inline auto enter( pass_t & pass, int ) -> decltype( pass.symtab, void() ) {
 			pass.symtab.enterScope();
 		}
@@ -278,5 +278,5 @@
 
 		template<typename pass_t>
-		static inline auto leave( pass_t & pass, int ) -> decltype( pass.symtab.leaveScope(), void() ) {
+		static inline auto leave( pass_t & pass, int ) -> decltype( pass.symtab, void() ) {
 			pass.symtab.leaveScope();
 		}
Index: src/ResolvExpr/AdjustExprType.cc
===================================================================
--- src/ResolvExpr/AdjustExprType.cc	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/ResolvExpr/AdjustExprType.cc	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -100,10 +100,11 @@
 
 namespace {
-	struct AdjustExprType_new final : public ast::WithShortCircuiting {
+	class AdjustExprType_new final : public ast::WithShortCircuiting {
+		const ast::SymbolTable & symtab;
+	public:
 		const ast::TypeEnvironment & tenv;
-		const ast::SymbolTable & symtab;
 
 		AdjustExprType_new( const ast::TypeEnvironment & e, const ast::SymbolTable & syms )
-		: tenv( e ), symtab( syms ) {}
+		: symtab( syms ), tenv( e ) {}
 
 		void premutate( const ast::VoidType * ) { visit_children = false; }
Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -594,7 +594,8 @@
 
 	/// Actually visits expressions to find their candidate interpretations
-	struct Finder final : public ast::WithShortCircuiting {
+	class Finder final : public ast::WithShortCircuiting {
+		const ast::SymbolTable & symtab;
+	public:
 		CandidateFinder & selfFinder;
-		const ast::SymbolTable & symtab;
 		CandidateList & candidates;
 		const ast::TypeEnvironment & tenv;
@@ -602,5 +603,5 @@
 
 		Finder( CandidateFinder & f )
-		: selfFinder( f ), symtab( f.symtab ), candidates( f.candidates ), tenv( f.env ), 
+		: symtab( f.localSyms ), selfFinder( f ), candidates( f.candidates ), tenv( f.env ), 
 		  targetType( f.targetType ) {}
 		
@@ -1558,5 +1559,5 @@
 		std::vector< std::string > errors;
 		for ( CandidateRef & candidate : candidates ) {
-			satisfyAssertions( candidate, symtab, satisfied, errors );
+			satisfyAssertions( candidate, localSyms, satisfied, errors );
 		}
 
@@ -1613,5 +1614,5 @@
 			r->expr = ast::mutate_field( 
 				r->expr.get(), &ast::Expr::result, 
-				adjustExprType( r->expr->result, r->env, symtab ) );
+				adjustExprType( r->expr->result, r->env, localSyms ) );
 		}
 	}
@@ -1631,5 +1632,5 @@
 
 	for ( const auto & x : xs ) {
-		out.emplace_back( symtab, env );
+		out.emplace_back( localSyms, env );
 		out.back().find( x, ResolvMode::withAdjustment() );
 		
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -28,12 +28,12 @@
 struct CandidateFinder {
 	CandidateList candidates;          ///< List of candidate resolutions
-	const ast::SymbolTable & symtab;   ///< Symbol table to lookup candidates
+	const ast::SymbolTable & localSyms;   ///< Symbol table to lookup candidates
 	const ast::TypeEnvironment & env;  ///< Substitutions performed in this resolution
 	ast::ptr< ast::Type > targetType;  ///< Target type for resolution
 
 	CandidateFinder( 
-		const ast::SymbolTable & symtab, const ast::TypeEnvironment & env, 
+		const ast::SymbolTable & syms, const ast::TypeEnvironment & env, 
 		const ast::Type * tt = nullptr )
-	: candidates(), symtab( symtab ), env( env ), targetType( tt ) {}
+	: candidates(), localSyms( syms ), env( env ), targetType( tt ) {}
 
 	/// Fill candidates with feasible resolutions for `expr`
Index: src/ResolvExpr/PolyCost.cc
===================================================================
--- src/ResolvExpr/PolyCost.cc	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/ResolvExpr/PolyCost.cc	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -58,11 +58,12 @@
 
 // TODO: When the old PolyCost is torn out get rid of the _new suffix.
-struct PolyCost_new {
+class PolyCost_new {
+	const ast::SymbolTable &symtab;
+public:
 	int result;
-	const ast::SymbolTable &symtab;
 	const ast::TypeEnvironment &env_;
 
-	PolyCost_new( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) :
-		result( 0 ), symtab( symtab ), env_( env ) {}
+	PolyCost_new( const ast::SymbolTable & symtab, const ast::TypeEnvironment & env ) 
+	: symtab( symtab ), result( 0 ), env_( env ) {}
 
 	void previsit( const ast::TypeInstType * type ) {
Index: src/Tuples/TupleAssignment.cc
===================================================================
--- src/Tuples/TupleAssignment.cc	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/Tuples/TupleAssignment.cc	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -464,5 +464,5 @@
 					// resolve ctor/dtor for the new object
 					ast::ptr< ast::Init > ctorInit = ResolvExpr::resolveCtorInit( 
-							InitTweak::genCtorInit( location, ret ), spotter.crntFinder.symtab );
+							InitTweak::genCtorInit( location, ret ), spotter.crntFinder.localSyms );
 					// remove environments from subexpressions of stmtExpr
 					ast::Pass< EnvRemover > rm{ env };
@@ -559,5 +559,5 @@
 					// resolve the cast expression so that rhsCand return type is bound by the cast 
 					// type as needed, and transfer the resulting environment
-					ResolvExpr::CandidateFinder finder{ spotter.crntFinder.symtab, env };
+					ResolvExpr::CandidateFinder finder{ spotter.crntFinder.localSyms, env };
 					finder.find( rhsCand->expr, ResolvExpr::ResolvMode::withAdjustment() );
 					assert( finder.candidates.size() == 1 );
@@ -608,5 +608,5 @@
 					// explode the LHS so that each field of a tuple-valued expr is assigned
 					ResolvExpr::CandidateList lhs;
-					explode( *lhsCand, crntFinder.symtab, back_inserter(lhs), true );
+					explode( *lhsCand, crntFinder.localSyms, back_inserter(lhs), true );
 					for ( ResolvExpr::CandidateRef & cand : lhs ) {
 						// each LHS value must be a reference - some come in with a cast, if not 
@@ -628,5 +628,5 @@
 							if ( isTuple( rhsCand->expr ) ) {
 								// multiple assignment
-								explode( *rhsCand, crntFinder.symtab, back_inserter(rhs), true );
+								explode( *rhsCand, crntFinder.localSyms, back_inserter(rhs), true );
 								matcher.reset( 
 									new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } );
@@ -647,5 +647,5 @@
 							// multiple assignment
 							ResolvExpr::CandidateList rhs;
-							explode( rhsCand, crntFinder.symtab, back_inserter(rhs), true );
+							explode( rhsCand, crntFinder.localSyms, back_inserter(rhs), true );
 							matcher.reset( 
 								new MultipleAssignMatcher{ *this, expr->location, lhs, rhs } );
@@ -677,5 +677,5 @@
 				)
 
-				ResolvExpr::CandidateFinder finder{ crntFinder.symtab, matcher->env };
+				ResolvExpr::CandidateFinder finder{ crntFinder.localSyms, matcher->env };
 
 				try {
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 28af3894a3f48635b14d9b38bcb17e753eb4d321)
+++ src/main.cc	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -29,4 +29,5 @@
 #include <string>                           // for char_traits, operator<<
 
+#include "AST/Convert.hpp"
 #include "CompilationState.h"
 #include "../config.h"                      // for CFA_LIBDIR
@@ -302,5 +303,10 @@
 		} // if
 
-		PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
+		// PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
+		{
+			auto transUnit = convert( move( translationUnit ) );
+			PASS( "Resolve", ResolvExpr::resolve( transUnit ) );
+			translationUnit = convert( move( transUnit ) );
+		}
 		if ( exprp ) {
 			dump( translationUnit );
