Nullable types prohibited in supertypes
This commit is contained in:
@@ -107,6 +107,11 @@ public class ClassDescriptorResolver {
|
||||
if (typeReference != null) {
|
||||
result.add(resolver.resolveType(extensibleScope, typeReference));
|
||||
JetTypeElement typeElement = typeReference.getTypeElement();
|
||||
while (typeElement instanceof JetNullableType) {
|
||||
JetNullableType nullableType = (JetNullableType) typeElement;
|
||||
trace.getErrorHandler().genericError(nullableType.getQuestionMarkNode(), "A supertype cannot be nullable");
|
||||
typeElement = nullableType.getInnerType();
|
||||
}
|
||||
if (typeElement instanceof JetUserType) {
|
||||
JetUserType userType = (JetUserType) typeElement;
|
||||
List<JetTypeProjection> typeArguments = userType.getTypeArguments();
|
||||
|
||||
@@ -3,4 +3,4 @@ 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> {}
|
||||
trait Test : A<<error>in</error> Int>, B<<error>out</error> T>, C<<error>*</error>><error>?</error><error>?</error><error>?</error>, D<Int> {}
|
||||
Reference in New Issue
Block a user