Add FIR test for 'Exception' constructor resolve ambiguity (type alias)
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
fun box(): String = "OK"
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
if (box() == "OK") {
|
||||||
|
throw Exception("Hello")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
FILE: exception.kt
|
||||||
|
public final fun box(): R|kotlin/String| {
|
||||||
|
^box String(OK)
|
||||||
|
}
|
||||||
|
public final fun main(args: R|kotlin/Array<kotlin/String>|): R|kotlin/Unit| {
|
||||||
|
when () {
|
||||||
|
==(R|/box|(), String(OK)) -> {
|
||||||
|
throw <Ambiguity: Exception, [java/lang/Exception.Exception, java/lang/Exception.Exception]>#(String(Hello))
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Generated
+5
@@ -49,6 +49,11 @@ public class FirResolveTestCaseWithStdlibGenerated extends AbstractFirResolveTes
|
|||||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/concurrent.kt");
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/concurrent.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("exception.kt")
|
||||||
|
public void testException() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/exception.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("factoryFunctionOverloads.kt")
|
@TestMetadata("factoryFunctionOverloads.kt")
|
||||||
public void testFactoryFunctionOverloads() throws Exception {
|
public void testFactoryFunctionOverloads() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.kt");
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user