equal
deleted
inserted
replaced
2353 |
2353 |
2354 Types.MapVisitor<DiagnosticPosition> targetChecker = new Types.MapVisitor<DiagnosticPosition>() { |
2354 Types.MapVisitor<DiagnosticPosition> targetChecker = new Types.MapVisitor<DiagnosticPosition>() { |
2355 |
2355 |
2356 @Override |
2356 @Override |
2357 public Type visitClassType(ClassType t, DiagnosticPosition pos) { |
2357 public Type visitClassType(ClassType t, DiagnosticPosition pos) { |
2358 return t.isCompound() ? |
2358 return t.isIntersection() ? |
2359 visitIntersectionClassType((IntersectionClassType)t, pos) : t; |
2359 visitIntersectionClassType((IntersectionClassType)t, pos) : t; |
2360 } |
2360 } |
2361 |
2361 |
2362 public Type visitIntersectionClassType(IntersectionClassType ict, DiagnosticPosition pos) { |
2362 public Type visitIntersectionClassType(IntersectionClassType ict, DiagnosticPosition pos) { |
2363 Symbol desc = types.findDescriptorSymbol(makeNotionalInterface(ict)); |
2363 Symbol desc = types.findDescriptorSymbol(makeNotionalInterface(ict)); |
2384 if (i.isParameterized()) { |
2384 if (i.isParameterized()) { |
2385 targs.appendList(i.tsym.type.allparams()); |
2385 targs.appendList(i.tsym.type.allparams()); |
2386 } |
2386 } |
2387 supertypes.append(i.tsym.type); |
2387 supertypes.append(i.tsym.type); |
2388 } |
2388 } |
2389 IntersectionClassType notionalIntf = |
2389 IntersectionClassType notionalIntf = types.makeIntersectionType(supertypes.toList()); |
2390 (IntersectionClassType)types.makeCompoundType(supertypes.toList()); |
|
2391 notionalIntf.allparams_field = targs.toList(); |
2390 notionalIntf.allparams_field = targs.toList(); |
2392 notionalIntf.tsym.flags_field |= INTERFACE; |
2391 notionalIntf.tsym.flags_field |= INTERFACE; |
2393 return notionalIntf.tsym; |
2392 return notionalIntf.tsym; |
2394 } |
2393 } |
2395 |
2394 |
3945 if (bounds.length() == 0) { |
3944 if (bounds.length() == 0) { |
3946 return syms.objectType; |
3945 return syms.objectType; |
3947 } else if (bounds.length() == 1) { |
3946 } else if (bounds.length() == 1) { |
3948 return bounds.head.type; |
3947 return bounds.head.type; |
3949 } else { |
3948 } else { |
3950 Type owntype = types.makeCompoundType(TreeInfo.types(bounds)); |
3949 Type owntype = types.makeIntersectionType(TreeInfo.types(bounds)); |
3951 // ... the variable's bound is a class type flagged COMPOUND |
3950 // ... the variable's bound is a class type flagged COMPOUND |
3952 // (see comment for TypeVar.bound). |
3951 // (see comment for TypeVar.bound). |
3953 // In this case, generate a class tree that represents the |
3952 // In this case, generate a class tree that represents the |
3954 // bound class, ... |
3953 // bound class, ... |
3955 JCExpression extending; |
3954 JCExpression extending; |