[FIR] Properly handle callable references which were resolved with error

This commit is contained in:
Dmitriy Novozhilov
2021-04-15 14:06:30 +03:00
parent 450fb5e915
commit e869f8091a
74 changed files with 377 additions and 312 deletions
@@ -4,33 +4,33 @@
fun testWhen(x: Any?) {
val y = when (x) {
null -> ""
else -> ::unresolved
else -> ::<!UNRESOLVED_REFERENCE!>unresolved<!>
}
}
fun testWhenWithBraces(x: Any?) {
val z = when(x) {
null -> { "" }
else -> { ::unresolved }
else -> { ::<!UNRESOLVED_REFERENCE!>unresolved<!> }
}
}
fun testIf(x: Any?) {
val y = if (x != null) ::unresolved else null
val y = if (x != null) ::<!UNRESOLVED_REFERENCE!>unresolved<!> else null
}
fun testIfWithBraces(x: Any?) {
val z = if (x != null) { ::unresolved } else { null }
val z = if (x != null) { ::<!UNRESOLVED_REFERENCE!>unresolved<!> } else { null }
}
fun testElvis(x: Any?) {
val y = x ?: ::unresolved
val y = x ?: ::<!UNRESOLVED_REFERENCE!>unresolved<!>
}
fun testExclExcl() {
val y = :: unresolved<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
val y = :: <!UNRESOLVED_REFERENCE!>unresolved<!><!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
}
fun testTry() {
val v = try { ::unresolved } catch (e: Exception) {}
val v = try { ::<!UNRESOLVED_REFERENCE!>unresolved<!> } catch (e: Exception) {}
}