]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java
Merge "Resolve some dependency problems with SDK features"
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / Types.java
index b20ee9f121ba4890be21b58e53540de72b4a1a6a..9ea064cfd11bf4abf4094a900a53d9951dc24878 100644 (file)
@@ -112,6 +112,9 @@ public class Types {
     public static final TCon PROC = con(BUILTIN, "Proc");
     
     public static final TCon BRANCH_POINT = con(BUILTIN, "BranchPoint");
+    
+    public static final TCon CHRContext = con(BUILTIN, "CHRContext");
+    
 
     private volatile static TCon[] tupleCache = new TCon[] {
         UNIT, null
@@ -128,7 +131,7 @@ public class Types {
         }
 
     };
-    
+
     public static boolean isPrimitive(Type type) {
        return type == BOOLEAN || type == BYTE || type == CHARACTER || type == SHORT ||
                        type == INTEGER || type == LONG || type == FLOAT || type == DOUBLE || type == STRING;
@@ -1015,6 +1018,15 @@ public class Types {
         return result;
     }
     
+    public static TPred[] replace(TPred[] types, TVar[] from, Type[] to) {
+        if(types.length == 0)
+            return TPred.EMPTY_ARRAY;
+        TPred[] result = new TPred[types.length];
+        for(int i=0;i<types.length;++i)
+            result[i] = (TPred)types[i].replace(from, to);
+        return result;
+    }
+    
     public static <T extends Type> Type[] replace(Type[] types, THashMap<TVar, T> map) {
         if(types.length == 0)
             return Type.EMPTY_ARRAY;