[FIR] Replace usages of FirExpression.typeRef with coneTypeOrNull
#KT-59855 Fixed
This commit is contained in:
committed by
Space Team
parent
f60d81097c
commit
8d7c5b375e
@@ -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
@@ -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<!>
|
||||
|
||||
+9
@@ -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
|
||||
}
|
||||
|
||||
+9
@@ -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
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user