package org.simantics.scl.compiler.constants.singletons; import org.simantics.scl.compiler.constants.FunctionValue; import org.simantics.scl.compiler.internal.codegen.references.Val; import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder; import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; public class SafeCoerce extends FunctionValue { public SafeCoerce(TVar[] vars, Type in, Type out) { super(vars, Types.NO_EFFECTS, out, in); } @Override public Type applyExact(MethodBuilder mb, Val[] parameters) { parameters[0].push(mb); return getReturnType(); } @Override public String toString() { return "safeCoerce"; } }