Add FIR test for 'Exception' constructor resolve ambiguity (type alias)

This commit is contained in:
Mikhail Glukhikh
2019-05-14 09:24:09 +03:00
parent b72f3aa206
commit 90009f002c
3 changed files with 26 additions and 0 deletions
@@ -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 -> {
}
}
}
@@ -49,6 +49,11 @@ public class FirResolveTestCaseWithStdlibGenerated extends AbstractFirResolveTes
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")
public void testFactoryFunctionOverloads() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/factoryFunctionOverloads.kt");