AnnotationTarget.PACKAGE was dropped
This commit is contained in:
@@ -187,7 +187,6 @@ public abstract class AnnotationCodegen {
|
||||
new EnumMap<KotlinTarget, ElementType>(KotlinTarget.class);
|
||||
|
||||
static {
|
||||
annotationTargetMap.put(KotlinTarget.PACKAGE, ElementType.PACKAGE);
|
||||
annotationTargetMap.put(KotlinTarget.CLASSIFIER, ElementType.TYPE);
|
||||
annotationTargetMap.put(KotlinTarget.ANNOTATION_CLASS, ElementType.ANNOTATION_TYPE);
|
||||
annotationTargetMap.put(KotlinTarget.CONSTRUCTOR, ElementType.CONSTRUCTOR);
|
||||
|
||||
@@ -165,7 +165,6 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
|
||||
TargetLists.T_TOP_LEVEL_FUNCTION
|
||||
}
|
||||
is JetPropertyAccessor -> if (annotated.isGetter) TargetLists.T_PROPERTY_GETTER else TargetLists.T_PROPERTY_SETTER
|
||||
is JetPackageDirective -> TargetLists.T_PACKAGE
|
||||
is JetTypeReference -> TargetLists.T_TYPE_REFERENCE
|
||||
is JetFile -> TargetLists.T_FILE
|
||||
is JetTypeParameter -> TargetLists.T_TYPE_PARAMETER
|
||||
@@ -205,7 +204,6 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
|
||||
}
|
||||
|
||||
val T_FILE = targetList(FILE)
|
||||
val T_PACKAGE = targetList(PACKAGE)
|
||||
|
||||
val T_CONSTRUCTOR = targetList(CONSTRUCTOR)
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ public object ModifierCheckerCore {
|
||||
val actualParents: List<KotlinTarget> = when (parentDescriptor) {
|
||||
is ClassDescriptor -> KotlinTarget.classActualTargets(parentDescriptor)
|
||||
is FunctionDescriptor -> listOf(FUNCTION)
|
||||
else -> listOf(PACKAGE)
|
||||
else -> listOf(FILE)
|
||||
}
|
||||
val possibleParents = possibleParentTargetMap[modifier] ?: return true
|
||||
if (possibleParents == KotlinTarget.ALL_TARGET_SET) return true
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@pck package test;
|
||||
|
||||
@pck class My {
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
package-info.java:3:1:compiler.err.annotation.type.not.applicable
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package test
|
||||
|
||||
target(AnnotationTarget.PACKAGE)
|
||||
annotation class pck
|
||||
@@ -1,8 +0,0 @@
|
||||
package test
|
||||
|
||||
test.pck() public/*package*/ interface `package-info` {
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.PACKAGE}) kotlin.annotation.annotation() internal final class pck : kotlin.Annotation {
|
||||
public constructor pck()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<!UNRESOLVED_REFERENCE!>myAnnotation<!> <!WRONG_MODIFIER_TARGET!>public<!> package illegal_modifiers
|
||||
<!UNRESOLVED_REFERENCE, WRONG_ANNOTATION_TARGET!>myAnnotation<!> <!WRONG_MODIFIER_TARGET!>public<!> package illegal_modifiers
|
||||
|
||||
abstract class A() {
|
||||
<!INCOMPATIBLE_MODIFIERS!>abstract<!> <!INCOMPATIBLE_MODIFIERS!>final<!> fun f()
|
||||
|
||||
@@ -31,7 +31,7 @@ public open class AnnotationTargets {
|
||||
public constructor multiple()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.PACKAGE}) public final class packag : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {}) public final class packag : kotlin.Annotation {
|
||||
public constructor packag()
|
||||
}
|
||||
|
||||
|
||||
-6
@@ -622,12 +622,6 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("package-info.kt")
|
||||
public void testPackage_info() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/targets/package-info.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parameter.kt")
|
||||
public void testParameter() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileJavaAgainstKotlin/targets/parameter.kt");
|
||||
|
||||
Reference in New Issue
Block a user