MISSING_VAL_ON_ANNOTATION_PARAMETER reported in DeclarationsChecker
This commit is contained in:
@@ -239,8 +239,6 @@ public class DeclarationResolver {
|
||||
@NotNull MutableClassDescriptor classDescriptor,
|
||||
@NotNull JetClass klass
|
||||
) {
|
||||
boolean isAnnotationClass = DescriptorUtils.isAnnotationClass(classDescriptor);
|
||||
|
||||
// TODO : not all the parameters are real properties
|
||||
JetScope memberScope = classDescriptor.getScopeForClassHeaderResolution();
|
||||
ConstructorDescriptor constructorDescriptor = descriptorResolver.resolvePrimaryConstructorDescriptor(memberScope, classDescriptor, klass, trace);
|
||||
@@ -262,9 +260,6 @@ public class DeclarationResolver {
|
||||
c.getPrimaryConstructorParameterProperties().put(parameter, propertyDescriptor);
|
||||
}
|
||||
else {
|
||||
if (isAnnotationClass) {
|
||||
trace.report(MISSING_VAL_ON_ANNOTATION_PARAMETER.on(parameter));
|
||||
}
|
||||
notProperties.add(valueParameterDescriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ public class DeclarationsChecker {
|
||||
}
|
||||
else if (aClass.isAnnotation()) {
|
||||
checkAnnotationClassWithBody(aClass);
|
||||
checkValOnAnnotationParameter(aClass);
|
||||
}
|
||||
else if (aClass.isEnum()) {
|
||||
checkEnumModifiers(aClass);
|
||||
@@ -249,6 +250,14 @@ public class DeclarationsChecker {
|
||||
}
|
||||
}
|
||||
|
||||
private void checkValOnAnnotationParameter(JetClass aClass) {
|
||||
for (JetParameter parameter : aClass.getPrimaryConstructorParameters()) {
|
||||
if (parameter.getValOrVarNode() == null) {
|
||||
trace.report(MISSING_VAL_ON_ANNOTATION_PARAMETER.on(parameter));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkOpenMembers(ClassDescriptorWithResolutionScopes classDescriptor) {
|
||||
for (CallableMemberDescriptor memberDescriptor : classDescriptor.getDeclaredCallableMembers()) {
|
||||
if (memberDescriptor.getKind() != CallableMemberDescriptor.Kind.DECLARATION) continue;
|
||||
|
||||
Reference in New Issue
Block a user