X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftypes%2FTFun.java;h=620ef18307421a9bcfeced6410a6ff3045dd4ff9;hb=e515d1fda563f0fa3b8b71f9099696cf49a06d25;hp=e26c5b07ac923922a8c4e4270ede948b3b1f3cbb;hpb=9a175feb652b2b7bba7afa540831b9076be3c10e;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TFun.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TFun.java index e26c5b07a..620ef1830 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TFun.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TFun.java @@ -57,7 +57,7 @@ public class TFun extends Type { public TypeAst toTypeAst(TypeUnparsingContext context) { TypeAst domainAst = domain.toTypeAst(context); TypeAst rangeAst = range.toTypeAst(context); - if(Types.canonical(effect) != Types.NO_EFFECTS) + if(Types.canonical(effect) != Types.NO_EFFECTS && !context.showSkeletons) rangeAst = new TEffectAst(effect.toTypeAst(context), rangeAst); Type dom = Types.canonical(domain); if(dom instanceof TPred) @@ -209,6 +209,22 @@ public class TFun extends Type { return hash; } + @Override + public int skeletonHashCode(int hash) { + hash = HashCodeUtils.updateWithPreprocessedValue(hash, FUN_HASH); + hash = domain.skeletonHashCode(hash); + hash = range.skeletonHashCode(hash); + return hash; + } + + @Override + public int skeletonHashCode(int hash, TVar[] boundVars) { + hash = HashCodeUtils.updateWithPreprocessedValue(hash, FUN_HASH); + hash = domain.skeletonHashCode(hash, boundVars); + hash = range.skeletonHashCode(hash, boundVars); + return hash; + } + public Type getCanonicalDomain() { if(domain instanceof TMetaVar) domain = domain.canonical(); @@ -243,4 +259,9 @@ public class TFun extends Type { public Kind getKind(Environment context) { return Kinds.STAR; } + + @Override + public Type[] skeletonCanonicalChildren() { + return new Type[] {Skeletons.canonicalSkeleton(domain), Skeletons.canonicalSkeleton(range)}; + } }