1 package org.simantics.scl.compiler.internal.codegen.types;
3 import org.cojen.classfile.TypeDesc;
4 import org.simantics.scl.compiler.elaboration.modules.TypeConstructor;
5 import org.simantics.scl.compiler.types.TCon;
6 import org.simantics.scl.compiler.types.Type;
7 import org.simantics.scl.compiler.types.kinds.Kind;
9 public class StandardTypeConstructor extends TypeConstructor {
10 private TypeDesc typeDesc; // null, if trivial data type (one constructor with one parameter)
11 public boolean external;
13 public StandardTypeConstructor(TCon con, Kind kind) {
17 public StandardTypeConstructor(TCon con, Kind kind, TypeDesc typeDesc) {
19 this.typeDesc = typeDesc;
22 public StandardTypeConstructor(TCon con, Kind kind, TypeDesc typeDesc, String documentation) {
24 this.typeDesc = typeDesc;
25 this.documentation = documentation;
28 public void setTypeDesc(TypeDesc typeDesc) {
29 this.typeDesc = typeDesc;
32 public TypeDesc getTypeDesc() {
37 public TypeDesc construct(JavaTypeTranslator translator, Type[] parameters) {
39 typeDesc = translator.toTypeDesc(constructors[0].parameterTypes[0]);