1 package org.simantics.scl.compiler.constants.singletons;
3 import org.simantics.scl.compiler.constants.FunctionValue;
4 import org.simantics.scl.compiler.internal.codegen.references.Val;
5 import org.simantics.scl.compiler.internal.codegen.utils.MethodBuilder;
6 import org.simantics.scl.compiler.types.TCon;
7 import org.simantics.scl.compiler.types.TVar;
8 import org.simantics.scl.compiler.types.Type;
9 import org.simantics.scl.compiler.types.Types;
10 import org.simantics.scl.compiler.types.kinds.Kinds;
12 public class TypeOfConstant extends FunctionValue {
13 private static final TVar A = Types.var(Kinds.STAR);
14 private static final TCon Type = Types.con(Types.BUILTIN, "Type");
15 public static final TypeOfConstant INSTANCE = new TypeOfConstant();
17 private TypeOfConstant() {
18 super(new TVar[] {A}, Types.NO_EFFECTS, Type,
19 Types.pred(Types.TYPEABLE, A), A);
23 public Type applyExact(MethodBuilder mb, Val[] parameters) {
24 mb.push(parameters[0], Type);
25 return getReturnType();
29 public String toString() {