src/AST/TypeSubstitution.cpp
TypeSubstitution * TypeSubstitution::newFromExpr( const Expr * expr, const TypeSubstitution * env ) {
	if ( env ) {
		TypeSubstitution * newEnv = new TypeSubstitution();
		Pass<EnvTrimmer> trimmer( env, newEnv );
		expr->accept( trimmer );
		return newEnv;
	}
	return nullptr;
}
/// reduce environment to just the parts that are referenced in a given expression
reduce environment to just the parts that are referenced in a given expression
reduce environment to just the parts that are referenced in a given expression
TypeSubstitution * TypeSubstitution::newFromExpr( const Expr * expr, const TypeSubstitution * env ) {
	if ( env ) {
		TypeSubstitution * newEnv = new TypeSubstitution();
		Pass<EnvTrimmer> trimmer( env, newEnv );
		expr->accept( trimmer );
		return newEnv;
	}
	return nullptr;
}
TypeSubstitution * TypeSubstitution :: newFromExpr ( const Expr * expr , const TypeSubstitution * env ) { if ( env ) { TypeSubstitution * newEnv = new TypeSubstitution ( ) ; Pass < EnvTrimmer > trimmer ( env , newEnv ) ; expr -> accept ( trimmer ) ; return newEnv ; } return nullptr ; }
reduce environment to just the parts that are referenced in a given expression
reduce environment to just the parts that are referenced in a given expression