langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java
changeset 162 6620f2a8e265
parent 10 06bc494ca11e
child 324 c4029ac973a2
equal deleted inserted replaced
161:bfe63856332f 162:6620f2a8e265
   192     void minimizeInst(UndetVar that, Warner warn) throws NoInstanceException {
   192     void minimizeInst(UndetVar that, Warner warn) throws NoInstanceException {
   193         if (that.inst == null) {
   193         if (that.inst == null) {
   194             if (that.lobounds.isEmpty())
   194             if (that.lobounds.isEmpty())
   195                 that.inst = syms.botType;
   195                 that.inst = syms.botType;
   196             else if (that.lobounds.tail.isEmpty())
   196             else if (that.lobounds.tail.isEmpty())
   197                 that.inst = that.lobounds.head;
   197                 that.inst = that.lobounds.head.isPrimitive() ? syms.errType : that.lobounds.head;
   198             else {
   198             else {
   199                 that.inst = types.lub(that.lobounds);
   199                 that.inst = types.lub(that.lobounds);
   200                 if (that.inst == null)
   200             }
       
   201             if (that.inst == null || that.inst == syms.errType)
   201                     throw ambiguousNoInstanceException
   202                     throw ambiguousNoInstanceException
   202                         .setMessage("no.unique.minimal.instance.exists",
   203                         .setMessage("no.unique.minimal.instance.exists",
   203                                     that.qtype, that.lobounds);
   204                                     that.qtype, that.lobounds);
   204             }
       
   205             // VGJ: sort of inlined maximizeInst() below.  Adding
   205             // VGJ: sort of inlined maximizeInst() below.  Adding
   206             // bounds can cause lobounds that are above hibounds.
   206             // bounds can cause lobounds that are above hibounds.
   207             if (that.hibounds.isEmpty())
   207             if (that.hibounds.isEmpty())
   208                 return;
   208                 return;
   209             Type hb = null;
   209             Type hb = null;