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.TCon;
\r
7 import org.simantics.scl.compiler.types.TVar;
\r
8 import org.simantics.scl.compiler.types.Type;
\r
9 import org.simantics.scl.compiler.types.Types;
\r
10 import org.simantics.scl.compiler.types.kinds.Kinds;
\r
12 public class TypeOfProxyConstant extends FunctionValue {
\r
13 private static final TVar A = Types.var(Kinds.STAR);
\r
14 private static final TCon Type = Types.con(Types.BUILTIN, "Type");
\r
15 public static final TypeOfProxyConstant INSTANCE = new TypeOfProxyConstant();
\r
17 private TypeOfProxyConstant() {
\r
18 super(new TVar[] {A}, Types.NO_EFFECTS, Type,
\r
19 Types.pred(Types.TYPEABLE, A), Types.apply(Types.TYPE_PROXY, A));
\r
23 public Type applyExact(MethodBuilder mb, Val[] parameters) {
\r
24 mb.push(parameters[0], Type);
\r
25 return getReturnType();
\r
29 public String toString() {
\r
30 return "typeOfProxy";
\r