]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/TMetaVar.java
Fixed incorrect interaction of EAmbigious and TMetaVar.setRef
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / TMetaVar.java
index 00b289f46a1f1b934c5ab271386fedde11f38554..1596467bc2931541350fdfd0fd27a424e084e882 100644 (file)
@@ -92,10 +92,12 @@ public class TMetaVar extends Type {
 
     @Override
     public TypeAst toTypeAst(TypeUnparsingContext context) {
-        if(ref == null)
-            return new TVarAst(/*polarity.getSymbol() +*/ context.getName(this));
-        else
+        if(ref != null)
             return ref.toTypeAst(context);
+        else if(context.showSkeletons && skeletonRef != null)
+            return skeletonRef.toTypeAst(context);
+        else
+            return new TVarAst(/*polarity.getSymbol() +*/ context.getName(this));
     }
     
     @Override
@@ -168,6 +170,10 @@ public class TMetaVar extends Type {
         // Common case
         if(skeletonRef != null) {
             Skeletons.unifySkeletons(thisSkeleton, type);
+            if(ref != null) {
+                Types.unify(this, type);
+                return;
+            }
         }
         setRefBase(type);
     }