]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/constants/singletons/ClassConstant.java
HTTP/Client SCL module for HTTP requests
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / constants / singletons / ClassConstant.java
1 package org.simantics.scl.compiler.constants.singletons;
2
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.TVar;
7 import org.simantics.scl.compiler.types.Type;
8 import org.simantics.scl.compiler.types.Types;
9 import org.simantics.scl.compiler.types.kinds.Kinds;
10
11 public class ClassConstant extends FunctionValue {
12     
13     private static final TVar A = Types.var(Kinds.STAR);
14     public static final ClassConstant INSTANCE = new ClassConstant();
15     
16     private ClassConstant() {
17         super(new TVar[] {A}, Types.NO_EFFECTS, Types.apply(Types.CLASS, A), 
18                 Types.pred(Types.VEC_COMP, A));
19     }
20     
21     @Override
22     public Type applyExact(MethodBuilder mb, Val[] parameters) {
23         mb.push(parameters[0], Types.CLASS);
24         return getReturnType();
25     }
26 }