[FIR] Handle fully qualified expressions separately in tower resolver

This commit is contained in:
Mikhail Glukhikh
2020-01-10 17:11:43 +03:00
parent 587430ff90
commit 5c6341b4e4
36 changed files with 204 additions and 47 deletions
@@ -12,6 +12,6 @@ inline fun myRun(block: () -> Unit): Unit {
}
fun test() {
myRun { throw java.lang.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>() }
myRun { throw java.lang.IllegalArgumentException() }
val x: Int = 42
}
@@ -22,7 +22,7 @@ fun throwIfNotCalled() {
return@outer
}
}
throw java.lang.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>()
throw java.lang.IllegalArgumentException()
}
// x *is* initialized here, because if myRun was never called -> exception
// were thrown and control flow wouldn't be here
@@ -39,7 +39,7 @@ fun catchThrowIfNotCalled() {
return@outer
}
}
throw java.lang.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>()
throw java.lang.IllegalArgumentException()
}
} catch (ignored: java.lang.IllegalArgumentException) { }
@@ -12,6 +12,6 @@ inline fun <T> myRun(block: () -> T): T {
}
fun throwInLambda(): Int {
val x = myRun { throw java.lang.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>(); 42 }
val x = myRun { throw java.lang.IllegalArgumentException(); 42 }
return x
}
@@ -18,6 +18,6 @@ fun bar(b: Boolean?): Boolean {
// not pointless, but not supported yet
returns(true) implies (b == true)
}
if (b == null) throw java.lang.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>("")
if (b == null) throw java.lang.IllegalArgumentException("")
return b
}
@@ -18,7 +18,7 @@ fun testCheckWithMessage(x: Any?) {
}
fun testCheckWithFailingMessage(x: Any?) {
check(x is String) { throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalStateException<!>("What a strange idea") }
check(x is String) { throw kotlin.IllegalStateException("What a strange idea") }
x.length
}
@@ -17,7 +17,7 @@ fun testRequireWithMessage(x: Any?) {
}
fun testRequireWithFailingMessage(x: Any?) {
require(x is String) { throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalStateException<!>("What a strange idea") }
require(x is String) { throw kotlin.IllegalStateException("What a strange idea") }
x.length
}
@@ -8,7 +8,7 @@ fun myAssert(condition: Boolean, message: String = "") {
contract {
returns() implies (condition)
}
if (!condition) throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>(message)
if (!condition) throw kotlin.IllegalArgumentException(message)
}
fun test(x: Any?) {
@@ -8,7 +8,7 @@ fun myAssert(condition: Boolean) {
contract {
returns() implies (condition)
}
if (!condition) throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>("Assertion failed")
if (!condition) throw kotlin.IllegalArgumentException("Assertion failed")
}
fun testWithCatch(x: Any?) {
@@ -9,7 +9,7 @@ fun myAssert(condition: Boolean) {
contract {
returns() implies (condition)
}
if (!condition) throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>("Assertion failed")
if (!condition) throw kotlin.IllegalArgumentException("Assertion failed")
}
fun isString(x: Any?): Boolean {
@@ -8,7 +8,7 @@ fun myAssert(condition: Boolean) {
contract {
returns() implies (condition)
}
if (!condition) throw kotlin.<!UNRESOLVED_REFERENCE!>IllegalArgumentException<!>("Assertion failed")
if (!condition) throw kotlin.IllegalArgumentException("Assertion failed")
}
fun testAssertSmartcast(x: Any?) {