K1/K2: add a test for KT-62866
This commit is contained in:
committed by
Space Team
parent
3b9e08d6b8
commit
d6e67e43f9
+6
@@ -46441,6 +46441,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionVsStaticScope.kt")
|
||||||
|
public void testCompanionVsStaticScope() {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/companionVsStaticScope.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("constructorCase.kt")
|
@TestMetadata("constructorCase.kt")
|
||||||
public void testConstructorCase() {
|
public void testConstructorCase() {
|
||||||
|
|||||||
+6
@@ -46441,6 +46441,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionVsStaticScope.kt")
|
||||||
|
public void testCompanionVsStaticScope() {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/companionVsStaticScope.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("constructorCase.kt")
|
@TestMetadata("constructorCase.kt")
|
||||||
public void testConstructorCase() {
|
public void testConstructorCase() {
|
||||||
|
|||||||
+6
@@ -44071,6 +44071,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionVsStaticScope.kt")
|
||||||
|
public void testCompanionVsStaticScope() {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/companionVsStaticScope.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("constructorCase.kt")
|
@TestMetadata("constructorCase.kt")
|
||||||
public void testConstructorCase() {
|
public void testConstructorCase() {
|
||||||
|
|||||||
+6
@@ -44209,6 +44209,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionVsStaticScope.kt")
|
||||||
|
public void testCompanionVsStaticScope() {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/companionVsStaticScope.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("constructorCase.kt")
|
@TestMetadata("constructorCase.kt")
|
||||||
public void testConstructorCase() {
|
public void testConstructorCase() {
|
||||||
|
|||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
FILE: companionVsStaticScope.kt
|
||||||
|
public final class Foo : R|kotlin/Any| {
|
||||||
|
public constructor(): R|Foo| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final object Bar : R|kotlin/Any| {
|
||||||
|
private constructor(): R|Foo.Bar| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public open override fun toString(): R|kotlin/String| {
|
||||||
|
^toString String(object Bar)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final companion object Companion : R|kotlin/Any| {
|
||||||
|
private constructor(): R|Foo.Companion| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final val Bar: R|kotlin/Int| = Int(10)
|
||||||
|
public get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final fun <T> take(it: R|T|): R|T| {
|
||||||
|
^take R|<local>/it|
|
||||||
|
}
|
||||||
|
public final val x: R|Foo.Bar| = Q|Foo.Bar|
|
||||||
|
public get(): R|Foo.Bar|
|
||||||
|
public final val y: R|Foo.Bar| = R|/take|<R|Foo.Bar|>(Q|Foo.Bar|)
|
||||||
|
public get(): R|Foo.Bar|
|
||||||
|
public final val z: R|Foo.Bar| = Q|Foo.Bar|.R|kotlin/let|<R|Foo.Bar|, R|Foo.Bar|>(<L> = let@fun <anonymous>(it: R|Foo.Bar|): R|Foo.Bar| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||||
|
^ R|<local>/it|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public get(): R|Foo.Bar|
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-62866
|
||||||
|
// WITH_STDLIB
|
||||||
|
// FIR_DUMP
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
object Bar {
|
||||||
|
override fun toString(): String = "object Bar"
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val Bar = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T> take(it: T): T = it
|
||||||
|
|
||||||
|
val x = Foo.Bar // K1: val Bar, K2: object Bar
|
||||||
|
val y = take(Foo.Bar) // K1: val Bar, K2: object Bar
|
||||||
|
val z = Foo.Bar.let { it } // K1 & K2: object Bar
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public val x: kotlin.Int = 10
|
||||||
|
public val y: kotlin.Int
|
||||||
|
public val z: Foo.Bar
|
||||||
|
public fun </*0*/ T> take(/*0*/ it: T): T
|
||||||
|
|
||||||
|
public final class Foo {
|
||||||
|
public constructor Foo()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
|
public object Bar {
|
||||||
|
private constructor Bar()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
|
||||||
|
public companion object Companion {
|
||||||
|
private constructor Companion()
|
||||||
|
public final val Bar: kotlin.Int = 10
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -46499,6 +46499,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/classLiteralCase.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("companionVsStaticScope.kt")
|
||||||
|
public void testCompanionVsStaticScope() {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/companionVsStaticScope.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("constructorCase.kt")
|
@TestMetadata("constructorCase.kt")
|
||||||
public void testConstructorCase() {
|
public void testConstructorCase() {
|
||||||
|
|||||||
Reference in New Issue
Block a user