1692 } |
1692 } |
1693 else if (clazztype.isInterface()) { |
1693 else if (clazztype.isInterface()) { |
1694 //if the type of the instance creation expression is an interface |
1694 //if the type of the instance creation expression is an interface |
1695 //skip the method resolution step (JLS 15.12.2.7). The type to be |
1695 //skip the method resolution step (JLS 15.12.2.7). The type to be |
1696 //inferred is of the kind <X1,X2, ... Xn>C<X1,X2, ... Xn> |
1696 //inferred is of the kind <X1,X2, ... Xn>C<X1,X2, ... Xn> |
1697 clazztype = new ForAll(clazztype.tsym.type.allparams(), |
1697 clazztype = new ForAll(clazztype.tsym.type.allparams(), clazztype.tsym.type) { |
1698 clazztype.tsym.type); |
1698 @Override |
|
1699 public List<Type> getConstraints(TypeVar tv, ConstraintKind ck) { |
|
1700 switch (ck) { |
|
1701 case EXTENDS: return types.getBounds(tv); |
|
1702 default: return List.nil(); |
|
1703 } |
|
1704 } |
|
1705 @Override |
|
1706 public Type inst(List<Type> inferred, Types types) throws Infer.NoInstanceException { |
|
1707 // check that inferred bounds conform to their bounds |
|
1708 infer.checkWithinBounds(tvars, |
|
1709 types.subst(tvars, tvars, inferred), Warner.noWarnings); |
|
1710 return super.inst(inferred, types); |
|
1711 } |
|
1712 }; |
1699 } else { |
1713 } else { |
1700 //if the type of the instance creation expression is a class type |
1714 //if the type of the instance creation expression is a class type |
1701 //apply method resolution inference (JLS 15.12.2.7). The return type |
1715 //apply method resolution inference (JLS 15.12.2.7). The return type |
1702 //of the resolved constructor will be a partially instantiated type |
1716 //of the resolved constructor will be a partially instantiated type |
1703 ((ClassSymbol) clazztype.tsym).members_field = mapping.snd; |
1717 ((ClassSymbol) clazztype.tsym).members_field = mapping.snd; |