[FIR] test: add a test case for reified inline functions with a same name in different packages.
This commit is contained in:
committed by
Simon Ogorodnik
parent
11a26e540e
commit
2d85eddeb9
+6
@@ -494,6 +494,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reifiedTypeOverload.kt")
|
||||||
|
public void testReifiedTypeOverload() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("sealedClass.kt")
|
@TestMetadata("sealedClass.kt")
|
||||||
public void testSealedClass() throws Exception {
|
public void testSealedClass() throws Exception {
|
||||||
|
|||||||
+5
@@ -419,6 +419,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("reifiedTypeOverload.kt")
|
||||||
|
public void testReifiedTypeOverload() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("sealedClass.kt")
|
@TestMetadata("sealedClass.kt")
|
||||||
public void testSealedClass() throws Exception {
|
public void testSealedClass() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
FILE: classes.kt
|
||||||
|
package classes
|
||||||
|
|
||||||
|
public abstract class Foo : R|kotlin/Any| {
|
||||||
|
public constructor(): R|classes/Foo| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public abstract class Bar : R|kotlin/Any| {
|
||||||
|
public constructor(): R|classes/Bar| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
FILE: bar.kt
|
||||||
|
package classes.bar
|
||||||
|
|
||||||
|
public final inline fun <reified T : R|classes/Bar|> nameOf(): R|kotlin/String| {
|
||||||
|
^nameOf String(Bar)
|
||||||
|
}
|
||||||
|
FILE: foo.kt
|
||||||
|
package classes.foo
|
||||||
|
|
||||||
|
public final inline fun <reified T : R|classes/Foo|> nameOf(): R|kotlin/String| {
|
||||||
|
^nameOf String(Foo)
|
||||||
|
}
|
||||||
|
FILE: main.kt
|
||||||
|
package main
|
||||||
|
|
||||||
|
public final fun <T> foo(): R|kotlin/Unit| {
|
||||||
|
}
|
||||||
|
public final fun test(): R|kotlin/Unit| {
|
||||||
|
R|classes/bar/nameOf|<R|classes/Bar|>()
|
||||||
|
R|classes/foo/nameOf|<R|classes/Foo|>()
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
// FILE: classes.kt
|
||||||
|
package classes
|
||||||
|
|
||||||
|
abstract class Foo
|
||||||
|
abstract class Bar
|
||||||
|
|
||||||
|
// FILE: bar.kt
|
||||||
|
package classes.bar
|
||||||
|
|
||||||
|
import classes.Bar
|
||||||
|
|
||||||
|
inline fun <reified T : Bar> nameOf(): String {
|
||||||
|
return "Bar"
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: foo.kt
|
||||||
|
package classes.foo
|
||||||
|
|
||||||
|
import classes.Foo
|
||||||
|
|
||||||
|
inline fun <reified T : Foo> nameOf(): String {
|
||||||
|
return "Foo"
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
package main
|
||||||
|
|
||||||
|
import classes.*
|
||||||
|
import classes.bar.*
|
||||||
|
import classes.foo.*
|
||||||
|
|
||||||
|
fun <T> foo() {}
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
<!OVERLOAD_RESOLUTION_AMBIGUITY!>nameOf<!><Bar>()
|
||||||
|
<!OVERLOAD_RESOLUTION_AMBIGUITY!>nameOf<!><Foo>()
|
||||||
|
}
|
||||||
+6
@@ -494,6 +494,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reifiedTypeOverload.kt")
|
||||||
|
public void testReifiedTypeOverload() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("sealedClass.kt")
|
@TestMetadata("sealedClass.kt")
|
||||||
public void testSealedClass() throws Exception {
|
public void testSealedClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -494,6 +494,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/recursiveTypeAlias.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("reifiedTypeOverload.kt")
|
||||||
|
public void testReifiedTypeOverload() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/reifiedTypeOverload.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("sealedClass.kt")
|
@TestMetadata("sealedClass.kt")
|
||||||
public void testSealedClass() throws Exception {
|
public void testSealedClass() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user