X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftypes%2FTApply.java;h=bd58949a6309918eb1ee0fce39425231c4056149;hp=88d80882e67312989f945ee6a81524b79418fcad;hb=cb5fc8d606d8b322563e9345c441eecfa7f01753;hpb=eecd74faded034bd067094b42bbac0d286d8d9fa diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TApply.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TApply.java index 88d80882e..bd58949a6 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TApply.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TApply.java @@ -218,6 +218,22 @@ public class TApply extends Type { return hash; } + @Override + public int skeletonHashCode(int hash) { + hash = HashCodeUtils.updateWithPreprocessedValue(hash, APPLY_HASH); + hash = function.skeletonHashCode(hash); + hash = parameter.skeletonHashCode(hash); + return hash; + } + + @Override + public int skeletonHashCode(int hash, TVar[] boundVars) { + hash = HashCodeUtils.updateWithPreprocessedValue(hash, APPLY_HASH); + hash = function.skeletonHashCode(hash, boundVars); + hash = parameter.skeletonHashCode(hash, boundVars); + return hash; + } + public Type getCanonicalFunction() { if(function instanceof TMetaVar) function = function.canonical(); @@ -240,4 +256,9 @@ public class TApply extends Type { return getCanonicalFunction().equalsCanonical(apply.getCanonicalFunction()) && getCanonicalParameter().equalsCanonical(apply.getCanonicalParameter()); } + + @Override + public Type[] skeletonCanonicalChildren() { + return new Type[] {Skeletons.canonicalSkeleton(function), Skeletons.canonicalSkeleton(parameter)}; + } }