[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
@@ -88,6 +88,18 @@ public class Fe10IdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ex
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegate.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegate() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegate.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegateLibrary.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegateLibrary() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegateLibrary.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
||||||
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
||||||
|
|||||||
+12
@@ -88,6 +88,18 @@ public class FirIdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ext
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegate.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegate() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegate.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegateLibrary.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegateLibrary() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegateLibrary.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
||||||
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
||||||
|
|||||||
+12
@@ -88,6 +88,18 @@ public class FirStandaloneNormalAnalysisSourceModuleCollectDiagnosticsTestGenera
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegate.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegate() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegate.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inferTypeFromGetValueDelegateLibrary.kt")
|
||||||
|
public void testInferTypeFromGetValueDelegateLibrary() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegateLibrary.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
|
||||||
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
|
||||||
|
|||||||
+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