modified: ../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java

modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java

Konstruktur fuer ReferenceType mit zwei Argumenten versehen, um Generice unterscheiden zu können.
This commit is contained in:
Martin Plümicke 2019-04-05 11:59:34 +02:00
parent 547ad9601a
commit 16baa5eaa8
2 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ public class UnifyTypeFactory {
} }
ret = new ReferenceType(t.getName().toString(),new TypeParams(params)); ret = new ReferenceType(t.getName().toString(),new TypeParams(params));
}else{ }else{
ret = new ReferenceType(t.getName().toString()); ret = new ReferenceType(t.getName().toString(), false);
} }
return ret; return ret;
} }
@ -139,7 +139,7 @@ public class UnifyTypeFactory {
} }
public static UnifyType convert(GenericRefType t, Boolean innerType){ 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){ public static UnifyType convert(WildcardType t, Boolean innerType){

View File

@ -28,10 +28,10 @@ public class ReferenceType extends UnifyType {
return visitor.visit(this, ht); return visitor.visit(this, ht);
} }
public ReferenceType(String name) { public ReferenceType(String name, Boolean genericTypeVar) {
super(name, new TypeParams()); super(name, new TypeParams());
hashCode = 31 + 17 * typeName.hashCode() + 17 * typeParams.hashCode(); hashCode = 31 + 17 * typeName.hashCode() + 17 * typeParams.hashCode();
genericTypeVar = true; this.genericTypeVar = genericTypeVar;
} }
public ReferenceType(String name, UnifyType... params) { public ReferenceType(String name, UnifyType... params) {