Prohibit named parameters in function types in supertype position
This commit is contained in:
@@ -427,6 +427,17 @@ public class BodyResolver {
|
||||
JetTypeReference typeReference = entry.getKey();
|
||||
JetType supertype = entry.getValue();
|
||||
|
||||
JetTypeElement typeElement = typeReference.getTypeElement();
|
||||
if (typeElement instanceof JetFunctionType) {
|
||||
for (JetParameter parameter : ((JetFunctionType) typeElement).getParameters()) {
|
||||
PsiElement nameIdentifier = parameter.getNameIdentifier();
|
||||
|
||||
if (nameIdentifier != null) {
|
||||
trace.report(Errors.UNSUPPORTED.on(nameIdentifier, "named parameter in function type in supertype position"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean addSupertype = true;
|
||||
|
||||
ClassDescriptor classDescriptor = TypeUtils.getClassDescriptor(supertype);
|
||||
|
||||
Reference in New Issue
Block a user