3402 env.info.defaultSuperCallSite = t; |
3402 env.info.defaultSuperCallSite = t; |
3403 return new VarSymbol(0, names._super, |
3403 return new VarSymbol(0, names._super, |
3404 types.asSuper(env.enclClass.type, c), env.enclClass.sym); |
3404 types.asSuper(env.enclClass.type, c), env.enclClass.sym); |
3405 } |
3405 } |
3406 } |
3406 } |
3407 //find a direct superinterface that is a subtype of 'c' |
3407 //find a direct super type that is a subtype of 'c' |
3408 for (Type i : types.interfaces(env.enclClass.type)) { |
3408 for (Type i : types.directSupertypes(env.enclClass.type)) { |
3409 if (i.tsym.isSubClass(c, types) && i.tsym != c) { |
3409 if (i.tsym.isSubClass(c, types) && i.tsym != c) { |
3410 log.error(pos, "illegal.default.super.call", c, |
3410 log.error(pos, "illegal.default.super.call", c, |
3411 diags.fragment("redundant.supertype", c, i)); |
3411 diags.fragment("redundant.supertype", c, i)); |
3412 return syms.errSymbol; |
3412 return syms.errSymbol; |
3413 } |
3413 } |
3420 //where |
3420 //where |
3421 private List<Type> pruneInterfaces(Type t) { |
3421 private List<Type> pruneInterfaces(Type t) { |
3422 ListBuffer<Type> result = new ListBuffer<>(); |
3422 ListBuffer<Type> result = new ListBuffer<>(); |
3423 for (Type t1 : types.interfaces(t)) { |
3423 for (Type t1 : types.interfaces(t)) { |
3424 boolean shouldAdd = true; |
3424 boolean shouldAdd = true; |
3425 for (Type t2 : types.interfaces(t)) { |
3425 for (Type t2 : types.directSupertypes(t)) { |
3426 if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) { |
3426 if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) { |
3427 shouldAdd = false; |
3427 shouldAdd = false; |
3428 } |
3428 } |
3429 } |
3429 } |
3430 if (shouldAdd) { |
3430 if (shouldAdd) { |