K2: reproduce KT-58618

This commit is contained in:
Mikhail Glukhikh
2023-05-23 13:55:18 +02:00
committed by Space Team
parent 666239c587
commit 2cfa3d7e0d
8 changed files with 83 additions and 0 deletions
@@ -8950,6 +8950,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt");
}
@Test
@TestMetadata("noInferenceFromWrappedDelegate.kt")
public void testNoInferenceFromWrappedDelegate() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/noInferenceFromWrappedDelegate.kt");
}
@Test
@TestMetadata("nonDefaultAccessors.kt")
public void testNonDefaultAccessors() throws Exception {
@@ -8950,6 +8950,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt");
}
@Test
@TestMetadata("noInferenceFromWrappedDelegate.kt")
public void testNoInferenceFromWrappedDelegate() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/noInferenceFromWrappedDelegate.kt");
}
@Test
@TestMetadata("nonDefaultAccessors.kt")
public void testNonDefaultAccessors() throws Exception {
@@ -8950,6 +8950,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt");
}
@Test
@TestMetadata("noInferenceFromWrappedDelegate.kt")
public void testNoInferenceFromWrappedDelegate() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/noInferenceFromWrappedDelegate.kt");
}
@Test
@TestMetadata("nonDefaultAccessors.kt")
public void testNonDefaultAccessors() throws Exception {
@@ -8956,6 +8956,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt");
}
@Test
@TestMetadata("noInferenceFromWrappedDelegate.kt")
public void testNoInferenceFromWrappedDelegate() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/noInferenceFromWrappedDelegate.kt");
}
@Test
@TestMetadata("nonDefaultAccessors.kt")
public void testNonDefaultAccessors() throws Exception {
@@ -0,0 +1,13 @@
// FIR_DUMP
// WITH_REFLECT
import kotlin.reflect.KProperty
// Definitions
class State<T>(var value: T)
<!NOTHING_TO_INLINE!>inline<!> operator fun <T> State<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
inline fun <T> remember(block: () -> T): T = block()
// list should have a type of List<Int>, not Any?
val list by remember { State(listOf(0)) }
val first = list.<!UNRESOLVED_REFERENCE!>first<!>()
@@ -0,0 +1,26 @@
FILE: noInferenceFromWrappedDelegate.fir.kt
public final class State<T> : R|kotlin/Any| {
public constructor<T>(value: R|T|): R|State<T>| {
super<R|kotlin/Any|>()
}
public final var value: R|T| = R|<local>/value|
public get(): R|T|
public set(value: R|T|): R|kotlin/Unit|
}
public final inline operator fun <T> R|State<T>|.getValue(thisRef: R|kotlin/Any?|, property: R|kotlin/reflect/KProperty<*>|): R|T| {
^getValue this@R|/getValue|.R|SubstitutionOverride</State.value: R|T|>|
}
public final inline fun <T> remember(block: R|() -> T|): R|T| {
^remember R|<local>/block|.R|SubstitutionOverride<kotlin/Function0.invoke: R|T|>|()
}
public final val list: R|kotlin/Any?|by R|/remember|<R|State<kotlin/collections/List<kotlin/Int>>|>(<L> = remember@fun <anonymous>(): R|State<kotlin/collections/List<kotlin/Int>>| <inline=Inline, kind=UNKNOWN> {
^ R|/State.State|<R|kotlin/collections/List<kotlin/Int>|>(R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(0)))
}
)
public get(): R|kotlin/Any?| {
^ D|/list|.R|/getValue|<R|kotlin/collections/List<kotlin/Int>|>(Null(null), ::R|/list|)
}
public final val first: <ERROR TYPE REF: Unresolved name: first> = R|/list|.<Unresolved name: first>#()
public get(): <ERROR TYPE REF: Unresolved name: first>
@@ -0,0 +1,14 @@
// FIR_DUMP
// WITH_REFLECT
import kotlin.reflect.KProperty
// Definitions
class State<T>(var value: T)
<!NOTHING_TO_INLINE!>inline<!> operator fun <T> State<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
inline fun <T> remember(block: () -> T): T = block()
// list should have a type of List<Int>, not Any?
val list by remember { State(listOf(0)) }
val first = list.first()
@@ -8956,6 +8956,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt");
}
@Test
@TestMetadata("noInferenceFromWrappedDelegate.kt")
public void testNoInferenceFromWrappedDelegate() throws Exception {
runTest("compiler/testData/diagnostics/tests/delegatedProperty/noInferenceFromWrappedDelegate.kt");
}
@Test
@TestMetadata("nonDefaultAccessors.kt")
public void testNonDefaultAccessors() throws Exception {