Report UNSUPPORTED on annotations on type parameters of classes
This commit is contained in:
@@ -345,8 +345,8 @@ public class AnnotationResolver {
|
|||||||
return new AnnotationsImpl(result);
|
return new AnnotationsImpl(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reportUnsupportedAnnotationForTypeParameter(@NotNull JetModifierListOwner modifierListOwner, BindingTrace trace) {
|
public static void reportUnsupportedAnnotationForTypeParameter(@NotNull JetTypeParameter jetTypeParameter, @NotNull BindingTrace trace) {
|
||||||
JetModifierList modifierList = modifierListOwner.getModifierList();
|
JetModifierList modifierList = jetTypeParameter.getModifierList();
|
||||||
if (modifierList == null) return;
|
if (modifierList == null) return;
|
||||||
|
|
||||||
for (JetAnnotationEntry annotationEntry : modifierList.getAnnotationEntries()) {
|
for (JetAnnotationEntry annotationEntry : modifierList.getAnnotationEntries()) {
|
||||||
|
|||||||
@@ -206,6 +206,9 @@ public class DeclarationsChecker {
|
|||||||
|
|
||||||
private void checkClass(JetClass aClass, ClassDescriptorWithResolutionScopes classDescriptor) {
|
private void checkClass(JetClass aClass, ClassDescriptorWithResolutionScopes classDescriptor) {
|
||||||
checkOpenMembers(classDescriptor);
|
checkOpenMembers(classDescriptor);
|
||||||
|
if (TopDownAnalyzer.LAZY) {
|
||||||
|
checkTypeParameters(aClass);
|
||||||
|
}
|
||||||
if (aClass.isTrait()) {
|
if (aClass.isTrait()) {
|
||||||
checkTraitModifiers(aClass);
|
checkTraitModifiers(aClass);
|
||||||
checkConstructorInTrait(aClass);
|
checkConstructorInTrait(aClass);
|
||||||
@@ -222,6 +225,13 @@ public class DeclarationsChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkTypeParameters(JetTypeParameterListOwner typeParameterListOwner) {
|
||||||
|
// TODO: Support annotation for type parameters
|
||||||
|
for (JetTypeParameter typeParameter : typeParameterListOwner.getTypeParameters()) {
|
||||||
|
AnnotationResolver.reportUnsupportedAnnotationForTypeParameter(typeParameter, trace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void checkConstructorInTrait(JetClass klass) {
|
private void checkConstructorInTrait(JetClass klass) {
|
||||||
JetParameterList primaryConstructorParameterList = klass.getPrimaryConstructorParameterList();
|
JetParameterList primaryConstructorParameterList = klass.getPrimaryConstructorParameterList();
|
||||||
if (primaryConstructorParameterList != null) {
|
if (primaryConstructorParameterList != null) {
|
||||||
|
|||||||
@@ -111,8 +111,10 @@ public class DescriptorResolver {
|
|||||||
List<TypeParameterDescriptor> typeParameters = Lists.newArrayList();
|
List<TypeParameterDescriptor> typeParameters = Lists.newArrayList();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (JetTypeParameter typeParameter : classElement.getTypeParameters()) {
|
for (JetTypeParameter typeParameter : classElement.getTypeParameters()) {
|
||||||
// TODO: Support
|
if (!TopDownAnalyzer.LAZY) {
|
||||||
AnnotationResolver.reportUnsupportedAnnotationForTypeParameter(typeParameter, trace);
|
// TODO: Support
|
||||||
|
AnnotationResolver.reportUnsupportedAnnotationForTypeParameter(typeParameter, trace);
|
||||||
|
}
|
||||||
|
|
||||||
TypeParameterDescriptor typeParameterDescriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
TypeParameterDescriptor typeParameterDescriptor = TypeParameterDescriptorImpl.createForFurtherModification(
|
||||||
descriptor,
|
descriptor,
|
||||||
|
|||||||
Reference in New Issue
Block a user