src/share/classes/com/sun/tools/javac/code/Types.java

changeset 162
638d45788c9e
parent 157
433ee48257c0
child 185
d57378c34fdb
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Oct 24 12:46:34 2008 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Oct 24 12:46:51 2008 +0100
     1.3 @@ -709,16 +709,13 @@
     1.4          case UNDETVAR:
     1.5              if (s.tag == WILDCARD) {
     1.6                  UndetVar undetvar = (UndetVar)t;
     1.7 -
     1.8 -                // Because of wildcard capture, s must be on the left
     1.9 -                // hand side of an assignment.  Furthermore, t is an
    1.10 -                // underconstrained type variable, for example, one
    1.11 -                // that is only used in the return type of a method.
    1.12 -                // If the type variable is truly underconstrained, it
    1.13 -                // cannot have any low bounds:
    1.14 -                assert undetvar.lobounds.isEmpty() : undetvar;
    1.15 -
    1.16                  undetvar.inst = glb(upperBound(s), undetvar.inst);
    1.17 +                // We should check instantiated type against any of the
    1.18 +                // undetvar's lower bounds.
    1.19 +                for (Type t2 : undetvar.lobounds) {
    1.20 +                    if (!isSubtype(t2, undetvar.inst))
    1.21 +                        return false;
    1.22 +                }
    1.23                  return true;
    1.24              } else {
    1.25                  return isSameType(t, s);

mercurial