Skip to content

Commit

Permalink
Fixed ProducedType.minus() to deal with supertypes of simple types as…
Browse files Browse the repository at this point in the history
… it did for unions

This means that null.minus(Nothing) is now Bottom, for example, where previously it would
only work in the case of union types: (null|Integer).minus(Nothing) -> Integer
  • Loading branch information
FroMage committed Mar 15, 2012
1 parent c91bfde commit 0406d31
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ else if (p.isContravariant()) {
* given type.
*/
public ProducedType minus(ClassOrInterface ci) {
if (getDeclaration().equals(ci)) {
if (getDeclaration().equals(ci) || getSupertype(ci) != null) {
return getDeclaration().getUnit().getBottomDeclaration().getType();
}
else if (getDeclaration() instanceof UnionType) {
Expand Down

0 comments on commit 0406d31

Please sign in to comment.