CONSTRUCTOR_IN_TRAIT check moved to DeclarationsChecker
This commit is contained in:
@@ -272,13 +272,6 @@ public class DeclarationResolver {
|
||||
@NotNull MutableClassDescriptor classDescriptor,
|
||||
@NotNull JetClass klass
|
||||
) {
|
||||
if (classDescriptor.getKind() == ClassKind.TRAIT) {
|
||||
JetParameterList primaryConstructorParameterList = klass.getPrimaryConstructorParameterList();
|
||||
if (primaryConstructorParameterList != null) {
|
||||
trace.report(CONSTRUCTOR_IN_TRAIT.on(primaryConstructorParameterList));
|
||||
}
|
||||
}
|
||||
|
||||
boolean isAnnotationClass = DescriptorUtils.isAnnotationClass(classDescriptor);
|
||||
|
||||
// TODO : not all the parameters are real properties
|
||||
|
||||
@@ -102,6 +102,7 @@ public class DeclarationsChecker {
|
||||
checkOpenMembers(classDescriptor);
|
||||
if (aClass.isTrait()) {
|
||||
checkTraitModifiers(aClass);
|
||||
checkConstructorInTrait(aClass);
|
||||
}
|
||||
else if (aClass.isEnum()) {
|
||||
checkEnumModifiers(aClass);
|
||||
@@ -111,6 +112,13 @@ public class DeclarationsChecker {
|
||||
}
|
||||
}
|
||||
|
||||
private void checkConstructorInTrait(JetClass klass) {
|
||||
JetParameterList primaryConstructorParameterList = klass.getPrimaryConstructorParameterList();
|
||||
if (primaryConstructorParameterList != null) {
|
||||
trace.report(CONSTRUCTOR_IN_TRAIT.on(primaryConstructorParameterList));
|
||||
}
|
||||
}
|
||||
|
||||
private void checkTraitModifiers(JetClass aClass) {
|
||||
reportErrorIfHasIllegalModifier(aClass);
|
||||
JetModifierList modifierList = aClass.getModifierList();
|
||||
|
||||
Reference in New Issue
Block a user