Remove FIELD target from jvmStatic and platformStatic annotations
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ internal final class A {
|
|||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@field:kotlin.platform.platformStatic() internal final val b: kotlin.String
|
kotlin.platform.platformStatic() internal final val b: kotlin.String
|
||||||
internal final var test.A.c: kotlin.String
|
internal final var test.A.c: kotlin.String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ internal fun main(/*0*/ kotlin.Array<kotlin.String>): kotlin.Unit
|
|||||||
|
|
||||||
internal object A {
|
internal object A {
|
||||||
private constructor A()
|
private constructor A()
|
||||||
@field:kotlin.platform.platformStatic() internal final val b: kotlin.String
|
kotlin.platform.platformStatic() internal final val b: kotlin.String
|
||||||
internal final var test.A.c: kotlin.String
|
internal final var test.A.c: kotlin.String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package aaa
|
||||||
|
|
||||||
|
import kotlin.jvm.*
|
||||||
|
|
||||||
|
public object TestObject {
|
||||||
|
|
||||||
|
@jvmStatic
|
||||||
|
public val test: String = "test"
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun main(args: Array<String>) {
|
||||||
|
val h = aaa.TestObject.test
|
||||||
|
if (h != "test") {
|
||||||
|
throw Exception()
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -131,6 +131,12 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PlatformStaticInObject.A.kt")
|
||||||
|
public void testPlatformStaticInObject() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/PlatformStaticInObject.A.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("PlatformTypes.A.kt")
|
@TestMetadata("PlatformTypes.A.kt")
|
||||||
public void testPlatformTypes() throws Exception {
|
public void testPlatformTypes() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/PlatformTypes.A.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/PlatformTypes.A.kt");
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ interface KMutablePropertyImpl<R> : KMutableProperty<R>, KPropertyImpl<R> {
|
|||||||
|
|
||||||
private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean): FunctionCaller<*> {
|
private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean): FunctionCaller<*> {
|
||||||
fun isJvmStaticProperty() =
|
fun isJvmStaticProperty() =
|
||||||
Annotations.Companion.findAnyAnnotation(property.descriptor.annotations, PLATFORM_STATIC) != null ||
|
property.descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null ||
|
||||||
Annotations.Companion.findAnyAnnotation(property.descriptor.annotations, JVM_STATIC) != null
|
property.descriptor.annotations.findAnnotation(JVM_STATIC) != null
|
||||||
|
|
||||||
fun isNotNullProperty() =
|
fun isNotNullProperty() =
|
||||||
!TypeUtils.isNullableType(property.descriptor.type)
|
!TypeUtils.isNullableType(property.descriptor.type)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public annotation(retention = AnnotationRetention.BINARY, mustBeDocumented = tru
|
|||||||
* See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/java-interop.html#static-methods-and-fields)
|
* See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/java-interop.html#static-methods-and-fields)
|
||||||
* for more information.
|
* for more information.
|
||||||
*/
|
*/
|
||||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class jvmStatic
|
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class jvmStatic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
|||||||
deprecated("Use kotlin.jvm.jvmName instead", ReplaceWith("kotlin.jvm.jvmName"))
|
deprecated("Use kotlin.jvm.jvmName instead", ReplaceWith("kotlin.jvm.jvmName"))
|
||||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformName(public val name: String)
|
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformName(public val name: String)
|
||||||
|
|
||||||
target(FUNCTION, FIELD, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER)
|
target(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||||
deprecated("Use kotlin.jvm.jvmStatic instead", ReplaceWith("kotlin.jvm.jvmStatic"))
|
deprecated("Use kotlin.jvm.jvmStatic instead", ReplaceWith("kotlin.jvm.jvmStatic"))
|
||||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformStatic
|
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformStatic
|
||||||
|
|||||||
Reference in New Issue
Block a user