JvmName should have @Retention(AnnotationRetention.BINARY)

(TODO: fix JVM BE)
This commit is contained in:
Dmitry Petrov
2015-09-21 14:00:59 +03:00
parent da026f1480
commit 80cbee83ee
4 changed files with 14 additions and 1 deletions
@@ -0,0 +1,4 @@
class A {
val OK: String = "OK"
@JvmName("OK") get
}
@@ -0,0 +1,3 @@
fun main(args: Array<String>) {
if (A().OK != "OK") throw java.lang.AssertionError()
}
@@ -101,6 +101,12 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
doTest(fileName);
}
@TestMetadata("JvmNameOnAccessor.A.kt")
public void testJvmNameOnAccessor() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/JvmNameOnAccessor.A.kt");
doTest(fileName);
}
@TestMetadata("KotlinPropertyAsAnnotationParameter.A.kt")
public void testKotlinPropertyAsAnnotationParameter() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/KotlinPropertyAsAnnotationParameter.A.kt");
@@ -48,7 +48,7 @@ public annotation class JvmStatic
* @property name the name of the element.
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
public annotation class JvmName(public val name: String)