import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
import org.simantics.scl.compiler.common.precedence.Precedence;
import org.simantics.scl.compiler.constants.NoRepConstant;
-import org.simantics.scl.compiler.elaboration.contexts.EnvironmentalContext;
import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
return context.subsume(inferType(context), requiredType);
}
- protected Expression applyPUnit(EnvironmentalContext context) {
+ protected Expression applyPUnit(TypingContext context) {
Type type = Types.canonical(getType());
if(type instanceof TFun) {
TFun fun = (TFun)type;
if(fun.getCanonicalDomain() == Types.PUNIT) {
EApply result = new EApply(location, this, new ELiteral(NoRepConstant.PUNIT));
result.effect = fun.getCanonicalEffect();
+ context.declareEffect(this.location, result.effect);
return result;
}
}