Projections in immediate arguments to supertypes prohibited
This commit is contained in:
@@ -106,6 +106,16 @@ public class ClassDescriptorResolver {
|
|||||||
JetTypeReference typeReference = delegationSpecifier.getTypeReference();
|
JetTypeReference typeReference = delegationSpecifier.getTypeReference();
|
||||||
if (typeReference != null) {
|
if (typeReference != null) {
|
||||||
result.add(resolver.resolveType(extensibleScope, typeReference));
|
result.add(resolver.resolveType(extensibleScope, typeReference));
|
||||||
|
JetTypeElement typeElement = typeReference.getTypeElement();
|
||||||
|
if (typeElement instanceof JetUserType) {
|
||||||
|
JetUserType userType = (JetUserType) typeElement;
|
||||||
|
List<JetTypeProjection> typeArguments = userType.getTypeArguments();
|
||||||
|
for (JetTypeProjection typeArgument : typeArguments) {
|
||||||
|
if (typeArgument.getProjectionKind() != JetProjectionKind.NONE) {
|
||||||
|
trace.getErrorHandler().genericError(typeArgument.getProjectionNode(), "Projections are not allowed for immediate arguments of a supertype");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result.add(ErrorUtils.createErrorType("No type reference"));
|
result.add(ErrorUtils.createErrorType("No type reference"));
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
trait A<T> {}
|
||||||
|
trait B<T> {}
|
||||||
|
trait C<T> {}
|
||||||
|
trait D<T> {}
|
||||||
|
|
||||||
|
trait Test : A<<error>in</error> Int>, B<<error>out</error> T>, C<<error>*</error>>, D<Int> {}
|
||||||
Reference in New Issue
Block a user