]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/types/Types.java
Merged changes from SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / types / Types.java
index 5e332742ab29debd7f8c3674c4b2ac38f993448f..5e8c548878e4b10e010cb6fc8f0f7cddc8da18ef 100644 (file)
@@ -154,11 +154,13 @@ public class Types {
      * Get the concrete type pointed to by a chain of type meta-variables.
      */
     public static Type canonical(Type type) {
-        while(type instanceof TMetaVar) {
+        if(type instanceof TMetaVar) {
             TMetaVar metaVar = (TMetaVar)type;
             type = metaVar.ref;
             if(type == null)
                 return metaVar;
+            else
+                return metaVar.ref = canonical(type);
         }
         return type;
     }