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

changeset 1093
c0835c8489b0
parent 1072
d0257833498e
child 1108
b5d0b8effc85
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Sep 14 18:26:57 2011 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Fri Sep 16 14:16:11 2011 +0100
     1.3 @@ -508,8 +508,13 @@
     1.4              @Override
     1.5              public Boolean visitUndetVar(UndetVar t, Type s) {
     1.6                  //todo: test against origin needed? or replace with substitution?
     1.7 -                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN)
     1.8 +                if (t == s || t.qtype == s || s.tag == ERROR || s.tag == UNKNOWN) {
     1.9                      return true;
    1.10 +                } else if (s.tag == BOT) {
    1.11 +                    //if 's' is 'null' there's no instantiated type U for which
    1.12 +                    //U <: s (but 'null' itself, which is not a valid type)
    1.13 +                    return false;
    1.14 +                }
    1.15  
    1.16                  if (t.inst != null)
    1.17                      return isSubtypeNoCapture(t.inst, s); // TODO: ", warn"?

mercurial