package org.simantics.scl.compiler.elaboration.contexts; import org.simantics.scl.compiler.elaboration.expressions.EVariable; import org.simantics.scl.compiler.elaboration.expressions.Expression; import org.simantics.scl.compiler.elaboration.expressions.Variable; import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import gnu.trove.map.hash.THashMap; public class ReplaceContext { public final THashMap EMPTY_VARIABLE_MAP = new THashMap(); public THashMap tvarMap; public THashMap varMap; public final TypingContext typingContext; public boolean inPattern; public ReplaceContext(THashMap tvarMap, THashMap varMap, TypingContext typingContext) { this.tvarMap = tvarMap; this.varMap = varMap; this.typingContext = typingContext; this.inPattern = false; } public ReplaceContext(Variable[] from, Variable[] to) { this.tvarMap = EMPTY_VARIABLE_MAP; this.typingContext = null; this.inPattern = false; varMap = new THashMap(from.length); for(int i=0;i(), new THashMap(), typingContext); } }