[FIR] Replace usages of FirExpression.typeRef with coneTypeOrNull

#KT-59855 Fixed
This commit is contained in:
Kirill Rakhman
2023-08-04 10:43:25 +02:00
committed by Space Team
parent f60d81097c
commit 8d7c5b375e
76 changed files with 538 additions and 565 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ class MyColor(val x: Color.<!ENUM_ENTRY_AS_TYPE!>RED<!>, y: Color.<!ENUM_ENTRY_A
class Local : Color.<!ENUM_ENTRY_AS_TYPE!>RED<!>
fun local(arg: Color.<!ENUM_ENTRY_AS_TYPE!>RED<!>): Color.<!ENUM_ENTRY_AS_TYPE!>RED<!> = arg
val temp: Color.<!ENUM_ENTRY_AS_TYPE!>RED<!> = Color.RED
temp as? Color.<!ENUM_ENTRY_AS_TYPE, ENUM_ENTRY_AS_TYPE!>RED<!>
temp as? Color.<!ENUM_ENTRY_AS_TYPE!>RED<!>
if (temp is <!IS_ENUM_ENTRY!>Color.RED<!>) {
return temp as Color.<!ENUM_ENTRY_AS_TYPE!>RED<!>
}
+1 -1
View File
@@ -1,7 +1,7 @@
fun <K> foo(x: K) {}
val x1 = foo<(<!UNRESOLVED_REFERENCE!>unresolved<!>) -> Float> { it.<!UNRESOLVED_REFERENCE!>toFloat<!>() }
val x2 = foo<(<!UNRESOLVED_REFERENCE!>unresolved<!>) -> Float> { <!CANNOT_INFER_PARAMETER_TYPE!>it<!> -> it.<!UNRESOLVED_REFERENCE!>toFloat<!>() }
val x3 = foo<<!UNRESOLVED_REFERENCE!>unresolved<!>.() -> Float> { this.<!UNRESOLVED_REFERENCE!>toFloat<!>() }
val x3 = foo<<!UNRESOLVED_REFERENCE!>unresolved<!>.() -> Float> { <!CANNOT_INFER_PARAMETER_TYPE!>this<!>.<!UNRESOLVED_REFERENCE!>toFloat<!>() }
val x4 = foo<(Array<<!UNRESOLVED_REFERENCE!>unresolved<!>>) -> Int> { it.size }
fun <T> bar() = foo<(T) -> String> { it.toString() }
@@ -40,7 +40,7 @@ open class A {
fun foo() {
<!UNRESOLVED_REFERENCE!>topLevelFun<!>()
<!UNRESOLVED_REFERENCE!>topLevelFun<!>(1)
<!UNRESOLVED_REFERENCE!>topLevelProperty<!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>++<!>
<!UNRESOLVED_REFERENCE!>topLevelProperty<!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>++<!>
"".<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
1.<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
"".<!UNRESOLVED_REFERENCE!>topLevelExtensionProperty<!>
@@ -75,3 +75,12 @@ fun test5() {
c.x<!UNSAFE_CALL!>.<!>length // bad
d.x.length // ok
}
fun test6() {
var c: C? = null
var maybeC: C? = C("")
if (c == null) {
c = maybeC ?: throw Exception()
}
c.x
}
@@ -75,3 +75,12 @@ fun test5() {
c.x<!UNSAFE_CALL!>.<!>length // bad
<!DEBUG_INFO_SMARTCAST!>d.x<!>.length // ok
}
fun test6() {
var c: C? = null
var maybeC: C? = C("")
if (c == null) {
c = maybeC ?: throw Exception()
}
<!DEBUG_INFO_SMARTCAST!>c<!>.x
}
@@ -25,7 +25,7 @@ fun <M> materialize(): Processor<M> = TODO()
private fun foo(model: Model) {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER("M")!>materialize<!>().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER("T")!>apply<!> {
context(
this,
<!CANNOT_INFER_PARAMETER_TYPE!>this<!>,
Exec { m, p -> p.process(m) } // Note: Builder inference
)
}