[Analysis API] add diagnostic test of type inference from getValue delegate
^KT-62888
This commit is contained in:
committed by
Space Team
parent
3eb86ede96
commit
faf33e4fa4
+12
@@ -0,0 +1,12 @@
|
||||
import kotlin.reflect.KMutableProperty
|
||||
|
||||
class SimpleVarClass(var constructorVariable: Boolean) {
|
||||
var memberVariable: Boolean = constructorVariable
|
||||
}
|
||||
|
||||
fun moreFun(a: KMutableProperty<Boolean>) = a
|
||||
|
||||
fun testMutableProp() {
|
||||
moreFun(SimpleVarClass::constructorVariable)
|
||||
moreFun(SimpleVarClass::memberVariable)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Diagnostics from elements:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// IGNORE_FE10
|
||||
// KT-64503
|
||||
|
||||
// MODULE: lib
|
||||
// MODULE_KIND: LibraryBinary
|
||||
// FILE: Lib.kt
|
||||
class SimpleVarClass(var constructorVariable: Boolean) {
|
||||
var memberVariable: Boolean = constructorVariable
|
||||
}
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: usage.kt
|
||||
import kotlin.reflect.KMutableProperty
|
||||
|
||||
fun moreFun(a: KMutableProperty<Boolean>) = a
|
||||
|
||||
fun testMutableProp() {
|
||||
moreFun(SimpleVarClass::constructorVariable)
|
||||
moreFun(SimpleVarClass::memberVariable)
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
Diagnostics from elements:
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Diagnostics from elements:
|
||||
for PSI element of type KtNameReferenceExpression at (18,29-48)
|
||||
INAPPLICABLE_CANDIDATE text ranges: [(188,207)]
|
||||
PSI: KtNameReferenceExpression at (18,29-48)
|
||||
for PSI element of type KtNameReferenceExpression at (19,29-43)
|
||||
INAPPLICABLE_CANDIDATE text ranges: [(237,251)]
|
||||
PSI: KtNameReferenceExpression at (19,29-43)
|
||||
Reference in New Issue
Block a user