langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
changeset 42828 cce89649f958
parent 42819 4ce83e629dc1
child 42973 3795332b55c7
equal deleted inserted replaced
42827:36468b5fa7f4 42828:cce89649f958
   586         ClassSymbol csym = new ClassSymbol(cflags, name, env.enclClass.sym.outermostClass());
   586         ClassSymbol csym = new ClassSymbol(cflags, name, env.enclClass.sym.outermostClass());
   587         csym.completer = Completer.NULL_COMPLETER;
   587         csym.completer = Completer.NULL_COMPLETER;
   588         csym.members_field = WriteableScope.create(csym);
   588         csym.members_field = WriteableScope.create(csym);
   589         MethodSymbol instDescSym = new MethodSymbol(descSym.flags(), descSym.name, descType, csym);
   589         MethodSymbol instDescSym = new MethodSymbol(descSym.flags(), descSym.name, descType, csym);
   590         csym.members_field.enter(instDescSym);
   590         csym.members_field.enter(instDescSym);
   591         Type.ClassType ctype = new Type.ClassType(Type.noType, List.<Type>nil(), csym);
   591         Type.ClassType ctype = new Type.ClassType(Type.noType, List.nil(), csym);
   592         ctype.supertype_field = syms.objectType;
   592         ctype.supertype_field = syms.objectType;
   593         ctype.interfaces_field = targets;
   593         ctype.interfaces_field = targets;
   594         csym.type = ctype;
   594         csym.type = ctype;
   595         csym.sourcefile = ((ClassSymbol)csym.owner).sourcefile;
   595         csym.sourcefile = ((ClassSymbol)csym.owner).sourcefile;
   596         return csym;
   596         return csym;
  3160             // create new type variable without bounds
  3160             // create new type variable without bounds
  3161             TypeVar tv = new TypeVar(t.tsym, null, syms.botType,
  3161             TypeVar tv = new TypeVar(t.tsym, null, syms.botType,
  3162                                      t.getMetadata());
  3162                                      t.getMetadata());
  3163             // the new bound should use the new type variable in place
  3163             // the new bound should use the new type variable in place
  3164             // of the old
  3164             // of the old
  3165             tv.bound = subst(bound1, List.<Type>of(t), List.<Type>of(tv));
  3165             tv.bound = subst(bound1, List.of(t), List.of(tv));
  3166             return tv;
  3166             return tv;
  3167         }
  3167         }
  3168     }
  3168     }
  3169     // </editor-fold>
  3169     // </editor-fold>
  3170 
  3170 
  3760             List<Type> candidates = List.nil();
  3760             List<Type> candidates = List.nil();
  3761             for (Type erasedSupertype : mec) {
  3761             for (Type erasedSupertype : mec) {
  3762                 List<Type> lci = List.of(asSuper(ts[startIdx], erasedSupertype.tsym));
  3762                 List<Type> lci = List.of(asSuper(ts[startIdx], erasedSupertype.tsym));
  3763                 for (int i = startIdx + 1 ; i < ts.length ; i++) {
  3763                 for (int i = startIdx + 1 ; i < ts.length ; i++) {
  3764                     Type superType = asSuper(ts[i], erasedSupertype.tsym);
  3764                     Type superType = asSuper(ts[i], erasedSupertype.tsym);
  3765                     lci = intersect(lci, superType != null ? List.of(superType) : List.<Type>nil());
  3765                     lci = intersect(lci, superType != null ? List.of(superType) : List.nil());
  3766                 }
  3766                 }
  3767                 candidates = candidates.appendList(lci);
  3767                 candidates = candidates.appendList(lci);
  3768             }
  3768             }
  3769             //step 4 - let MEC be { G1, G2 ... Gn }, then we have that
  3769             //step 4 - let MEC be { G1, G2 ... Gn }, then we have that
  3770             //lub = lci(Inv(G1)) & lci(Inv(G2)) & ... & lci(Inv(Gn))
  3770             //lub = lci(Inv(G1)) & lci(Inv(G2)) & ... & lci(Inv(Gn))