From fd5902f6ddb978bbc33201c4beec0df9b2b12926 Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Fri, 13 Nov 2015 22:49:26 +0100 Subject: [PATCH] stricter equality condition for typeParams --- .../typinference/unify/model/ExtendsType.java | 2 +- .../typinference/unify/model/TypeParams.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/de/dhbwstuttgart/typinference/unify/model/ExtendsType.java b/src/de/dhbwstuttgart/typinference/unify/model/ExtendsType.java index d648c249a..e9dbc7c07 100644 --- a/src/de/dhbwstuttgart/typinference/unify/model/ExtendsType.java +++ b/src/de/dhbwstuttgart/typinference/unify/model/ExtendsType.java @@ -8,7 +8,7 @@ public final class ExtendsType extends Type { private Type extendedType; public ExtendsType(Type extendedType) { - super("? extends " + extendedType.getTypeParams(), extendedType.getTypeParams()); + super("? extends " + extendedType.getName(), extendedType.getTypeParams()); this.extendedType = extendedType; } diff --git a/src/de/dhbwstuttgart/typinference/unify/model/TypeParams.java b/src/de/dhbwstuttgart/typinference/unify/model/TypeParams.java index c6e3ee005..fe8dff83f 100644 --- a/src/de/dhbwstuttgart/typinference/unify/model/TypeParams.java +++ b/src/de/dhbwstuttgart/typinference/unify/model/TypeParams.java @@ -61,8 +61,14 @@ public final class TypeParams implements Iterable{ TypeParams other = (TypeParams) obj; - // TODO - return other.size() == this.size(); + if(other.size() != this.size()) + return false; + + for(int i = 0; i < this.size(); i++) + if(!(this.get(i).equals(other.get(i)))) + return false; + + return true; } }