diff --git a/src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java index d7528fad..36cbf223 100644 --- a/src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java +++ b/src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java @@ -103,7 +103,7 @@ public class UnifyTypeFactory { } ret = new ReferenceType(t.getName().toString(),new TypeParams(params)); }else{ - ret = new ReferenceType(t.getName().toString()); + ret = new ReferenceType(t.getName().toString(), false); } return ret; } @@ -139,7 +139,7 @@ public class UnifyTypeFactory { } public static UnifyType convert(GenericRefType t, Boolean innerType){ - return new ReferenceType(t.getParsedName()); + return new ReferenceType(t.getParsedName(), true); } public static UnifyType convert(WildcardType t, Boolean innerType){ diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java index 4bd51b27..4627dc30 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java @@ -28,10 +28,10 @@ public class ReferenceType extends UnifyType { return visitor.visit(this, ht); } - public ReferenceType(String name) { + public ReferenceType(String name, Boolean genericTypeVar) { super(name, new TypeParams()); hashCode = 31 + 17 * typeName.hashCode() + 17 * typeParams.hashCode(); - genericTypeVar = true; + this.genericTypeVar = genericTypeVar; } public ReferenceType(String name, UnifyType... params) {