Fixed bug in TypeUtils.intersect().

For "Foo", "Foo?" it returned "{Foo}" instead of "Foo"
This commit is contained in:
Evgeny Gerashchenko
2012-11-01 20:21:45 +04:00
parent 45df349f16
commit 8365cee0b5
2 changed files with 10 additions and 0 deletions
@@ -149,6 +149,12 @@ public class TypeUtils {
}
}
// Don't add type if it is already present, to avoid trivial type intersections in result
for (JetType other : resultingTypes) {
if (typeChecker.equalTypes(other, type)) {
continue outer;
}
}
resultingTypes.add(type);
}