1 package org.simantics.scl.compiler.constants.singletons;
\r
3 import org.simantics.scl.compiler.constants.FunctionValue;
\r
4 import org.simantics.scl.compiler.internal.codegen.references.Val;
\r
5 import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder;
\r
6 import org.simantics.scl.compiler.types.TVar;
\r
7 import org.simantics.scl.compiler.types.Type;
\r
8 import org.simantics.scl.compiler.types.Types;
\r
9 import org.simantics.scl.compiler.types.kinds.Kinds;
\r
11 public class UnsafeCoerce extends FunctionValue {
\r
12 private static TVar A = Types.var(Kinds.STAR);
\r
13 private static TVar B = Types.var(Kinds.STAR);
\r
14 public static final UnsafeCoerce INSTANCE = new UnsafeCoerce();
\r
16 private UnsafeCoerce() {
\r
17 super(new TVar[] {A, B}, Types.NO_EFFECTS, B, A);
\r
21 public Type applyExact(MethodBuilder mb, Val[] parameters) {
\r
22 mb.pushBoxed(parameters[0]);
\r
23 return getReturnType();
\r