]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TVar.java
Merged changes from feature/scl to master.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / TVar.java
index aeb9711453800ff1fce03878743880e613092d9b..df342dd5fb2e9074e9da1e3a3b3c9a76a6ff80a7 100644 (file)
@@ -59,11 +59,6 @@ public final class TVar extends Type {
         return this == obj;
     }
     
-    @Override
-    public int hashCode() {
-        return System.identityHashCode(this);
-    }
-    
     @Override
     public void updateHashCode(TypeHashCodeContext context) {
         TObjectIntHashMap<TVar> varHashCode = context.getVarHashCode();
@@ -141,6 +136,11 @@ public final class TVar extends Type {
         return this;
     }
     
+    @Override
+    public int hashCode() {
+        return System.identityHashCode(this);
+    }
+    
     @Override
     public int hashCode(int hash) {
         return HashCodeUtils.update(hash, System.identityHashCode(this));
@@ -156,6 +156,26 @@ public final class TVar extends Type {
         return HashCodeUtils.update(hash, System.identityHashCode(this));
     }
     
+    @Override
+    public int skeletonHashCode() {
+        return System.identityHashCode(this);
+    }
+    
+    @Override
+    public int skeletonHashCode(int hash) {
+        return HashCodeUtils.update(hash, System.identityHashCode(this));
+    }
+    
+    @Override
+    public int skeletonHashCode(int hash, TVar[] boundVars) {
+        for(int i=0;i<boundVars.length;++i)
+            if(boundVars[i] == this) {
+                hash = HashCodeUtils.updateWithPreprocessedValue(hash, BOUND_VAR_HASH);
+                return HashCodeUtils.update(hash, i);
+            }
+        return HashCodeUtils.update(hash, System.identityHashCode(this));
+    }
+    
     @Override
     public boolean equalsCanonical(Type other) {
         return this == other;
@@ -165,4 +185,9 @@ public final class TVar extends Type {
     public Kind getKind(Environment context) {
         return kind;
     }
+    
+    @Override
+    public Type[] skeletonCanonicalChildren() {
+        return EMPTY_ARRAY;
+    }
 }