]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TPred.java
Merged changes from feature/scl to master.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / TPred.java
index e8a0469c5d996f428c205c13018fe1e6e009707c..c28e62093abb249896adf6689135b1ac787296d2 100644 (file)
@@ -191,6 +191,24 @@ public class TPred extends Type {
             hash = parameter.hashCode(hash, boundVars);
         return hash;
     }
+    
+    @Override
+    public int skeletonHashCode(int hash) {
+        hash = HashCodeUtils.updateWithPreprocessedValue(hash, PRED_HASH);
+        hash = typeClass.skeletonHashCode(hash);
+        for(Type parameter : parameters)
+            hash = parameter.skeletonHashCode(hash);
+        return hash;
+    }
+    
+    @Override
+    public int skeletonHashCode(int hash, TVar[] boundVars) {
+        hash = HashCodeUtils.updateWithPreprocessedValue(hash, PRED_HASH);
+        hash = typeClass.skeletonHashCode(hash, boundVars);
+        for(Type parameter : parameters)
+            hash = parameter.skeletonHashCode(hash, boundVars);
+        return hash;
+    }
 
     @Override
     public boolean equalsCanonical(Type other) {
@@ -211,4 +229,12 @@ public class TPred extends Type {
     public Kind getKind(Environment context) {
         return Kinds.STAR;
     }
+
+    @Override
+    public Type[] skeletonCanonicalChildren() {
+        Type[] result = new Type[parameters.length];
+        for(int i=0;i<parameters.length;++i)
+            result[i] = Skeletons.canonicalSkeleton(parameters[i]);
+        return result;
+    }
 }