diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java index 194f48efe09..495b14e1cd8 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java @@ -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 diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java index 5cf08d0f34d..988ade87ea0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java @@ -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();