Add feature that allows references to synthetic properties with warning
See KT-35933 for details
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: +NewInference +ReferencesToSyntheticJavaProperties
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
// FILE: KotlinFile.kt
|
||||
|
||||
fun call(c: Any) {}
|
||||
|
||||
fun test() {
|
||||
JavaClass::foo
|
||||
call(JavaClass::foo)
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
public class JavaClass {
|
||||
public String getFoo() {}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: +NewInference +ReferencesToSyntheticJavaProperties
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
// FILE: KotlinFile.kt
|
||||
|
||||
fun call(c: Any) {}
|
||||
|
||||
fun test() {
|
||||
JavaClass::<!CALLABLE_REFERENCE_TO_JAVA_SYNTHETIC_PROPERTY!>foo<!>
|
||||
call(JavaClass::<!CALLABLE_REFERENCE_TO_JAVA_SYNTHETIC_PROPERTY!>foo<!>)
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
public class JavaClass {
|
||||
public String getFoo() {}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public fun call(/*0*/ c: kotlin.Any): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class JavaClass {
|
||||
public constructor JavaClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+9
-1
@@ -1,6 +1,14 @@
|
||||
// !LANGUAGE: -ReferencesToSyntheticJavaProperties
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
// FILE: KotlinFile.kt
|
||||
|
||||
fun bar() = JavaClass::foo
|
||||
fun call(c: Any) {}
|
||||
|
||||
fun test() {
|
||||
JavaClass::foo
|
||||
call(JavaClass::foo)
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
|
||||
+9
-1
@@ -1,6 +1,14 @@
|
||||
// !LANGUAGE: -ReferencesToSyntheticJavaProperties
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
// FILE: KotlinFile.kt
|
||||
|
||||
fun bar() = JavaClass::<!UNSUPPORTED!>foo<!>
|
||||
fun call(c: Any) {}
|
||||
|
||||
fun test() {
|
||||
JavaClass::<!UNSUPPORTED!>foo<!>
|
||||
call(JavaClass::<!UNSUPPORTED!>foo<!>)
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package
|
||||
|
||||
public fun bar(): kotlin.reflect.KProperty1<JavaClass, kotlin.String!>
|
||||
public fun call(/*0*/ c: kotlin.Any): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class JavaClass {
|
||||
public constructor JavaClass()
|
||||
|
||||
Reference in New Issue
Block a user