Skip to content

Commit 3b0e6f3

Browse files
committed
Kotlin#163 file annotations should be copied to ClassBinarySignature: add reproducer
1 parent 24cdd4e commit 3b0e6f3

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package cases.marker;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Target;
5+
6+
@Target(ElementType.TYPE)
7+
public @interface HiddenByJavaAnnotation {
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@file:HiddenByJavaAnnotation
2+
3+
package cases.marker
4+
5+
class ClassInAFileAnnotatedByHiddenJava
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@file:HiddenByKtAnnotation
2+
3+
package cases.marker
4+
5+
class ClassInAFileAnnotatedByHiddenKt

src/test/kotlin/cases/marker/marker.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ annotation class HiddenProperty
88

99
annotation class HiddenMethod
1010

11+
@Target(AnnotationTarget.FILE)
12+
annotation class HiddenByKtAnnotation
13+
1114
public class Foo {
1215
// HiddenField will be on the field
1316
@HiddenField

src/test/kotlin/cases/marker/marker.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ public final class cases/marker/Foo {
22
public fun <init> ()V
33
}
44

5+
public abstract interface annotation class cases/marker/HiddenByJavaAnnotation : java/lang/annotation/Annotation {
6+
}
7+
8+
public abstract interface annotation class cases/marker/HiddenByKtAnnotation : java/lang/annotation/Annotation {
9+
}
10+
511
public abstract interface annotation class cases/marker/HiddenField : java/lang/annotation/Annotation {
612
}
713

src/test/kotlin/tests/CasesPublicAPITest.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@ class CasesPublicAPITest {
4141

4242
@Test fun localClasses() { snapshotAPIAndCompare(testName.methodName) }
4343

44-
@Test fun marker() { snapshotAPIAndCompare(testName.methodName, setOf("cases/marker/HiddenField", "cases/marker/HiddenProperty", "cases/marker/HiddenMethod")) }
44+
@Test
45+
fun marker() {
46+
snapshotAPIAndCompare(
47+
testName.methodName, setOf(
48+
"cases/marker/HiddenField",
49+
"cases/marker/HiddenProperty",
50+
"cases/marker/HiddenMethod",
51+
"cases/marker/HiddenByJavaAnnotation",
52+
"cases/marker/HiddenByKtAnnotation",
53+
)
54+
)
55+
}
4556

4657
@Test fun nestedClasses() { snapshotAPIAndCompare(testName.methodName) }
4758

0 commit comments

Comments
 (0)