"union",
Types.NO_EFFECTS,
Type, Type, Type));
-
+ addValue("TUnion3", new JavaStaticMethod(
+ "org/simantics/scl/compiler/types/Types",
+ "union",
+ Types.NO_EFFECTS,
+ Type, Type, Type, Type));
+
StandardTypeConstructor TypeC = new StandardTypeConstructor(Type, Kinds.STAR,
TypeDesc.forClass("org/simantics/scl/compiler/types/Type"));
TypeC.setType(Type);
Types.pred(Types.TYPEABLE, union.effects[1])
});
}
+ else if(union.effects.length == 3) {
+ return new Reduction(
+ new EConstant(Builtins.INSTANCE.getValue("TUnion3")),
+ Type.EMPTY_ARRAY, new TPred[] {
+ Types.pred(Types.TYPEABLE, union.effects[0]),
+ Types.pred(Types.TYPEABLE, union.effects[1]),
+ Types.pred(Types.TYPEABLE, union.effects[2])
+ });
+ }
}
}
public static Type union(Type effect1, Type effect2) {
return new TUnion(effect1, effect2);
}
+
+ public static Type union(Type effect1, Type effect2, Type effect3) {
+ return new TUnion(effect1, effect2, effect3);
+ }
public static Type union(List<Type> effects) {
if(effects.size() == 0)