[FIR] Create synthetic properties for members of java annotations

#KT-41939 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-09-18 13:31:32 +03:00
parent da3a676c2a
commit 0e91c8f048
6 changed files with 127 additions and 2 deletions
@@ -0,0 +1,14 @@
// ISSUE: KT-41939
// FILE: Ann.java
public @interface Ann {
String value()
}
// FILE: main.kt
fun test(ann: Ann) {
ann.value
ann.<!UNRESOLVED_REFERENCE!>value<!>() // should be an error
}
@@ -0,0 +1,5 @@
FILE: main.kt
public final fun test(ann: R|Ann|): R|kotlin/Unit| {
R|<local>/ann|.R|/Ann.value|
R|<local>/ann|.<Unresolved name: value>#()
}
@@ -2031,6 +2031,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
public void testNoBackingFieldForExtension() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldForExtension.kt");
}
@TestMetadata("syntheticPropertiesForJavaAnnotations.kt")
public void testSyntheticPropertiesForJavaAnnotations() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/references")
@@ -2031,6 +2031,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
public void testNoBackingFieldForExtension() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldForExtension.kt");
}
@TestMetadata("syntheticPropertiesForJavaAnnotations.kt")
public void testSyntheticPropertiesForJavaAnnotations() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/references")