FIR: Support safe-calls new format in body resolution
^KT-38444 In Progress
This commit is contained in:
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
interface A
|
||||
|
||||
fun test_1(a: A?, convert: A.() -> String) {
|
||||
val s = a?.convert()
|
||||
}
|
||||
|
||||
fun test_2(a: A, convert: A.() -> String) {
|
||||
val s = a.convert()
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
FILE: extensionInvokeAfterSafeCall.kt
|
||||
public abstract interface A : R|kotlin/Any| {
|
||||
}
|
||||
public final fun test_1(a: R|A?|, convert: R|A.() -> kotlin/String|): R|kotlin/Unit| {
|
||||
lval s: R|kotlin/String?| = R|<local>/a|?.{ R|<local>/convert|.R|FakeOverride<kotlin/Function1.invoke: R|kotlin/String|>|($subj$) }
|
||||
}
|
||||
public final fun test_2(a: R|A|, convert: R|A.() -> kotlin/String|): R|kotlin/Unit| {
|
||||
lval s: R|kotlin/String| = R|<local>/convert|.R|FakeOverride<kotlin/Function1.invoke: R|kotlin/String|>|(R|<local>/a|)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
typealias MyTypeAlias = (() -> String?)?
|
||||
fun foo(x: MyTypeAlias) {
|
||||
|
||||
x?.let { y -> y()?.let { result -> bar(result) } }
|
||||
}
|
||||
|
||||
fun bar(x: String) = x
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
FILE: safeCallOnTypeAlias.kt
|
||||
public final typealias MyTypeAlias = R|() -> kotlin/String?|
|
||||
public final fun foo(x: R|MyTypeAlias|): R|kotlin/Unit| {
|
||||
R|<local>/x|?.{ $subj$.R|kotlin/let|<R|() -> kotlin/String?|, R|kotlin/String|>(<L> = let@fun <anonymous>(y: R|() -> kotlin/String?|): R|kotlin/String| <kind=EXACTLY_ONCE> {
|
||||
^ R|<local>/y|.R|FakeOverride<kotlin/Function0.invoke: R|kotlin/String?|>|()?.{ $subj$.R|kotlin/let|<R|kotlin/String|, R|kotlin/String|>(<L> = let@fun <anonymous>(result: R|kotlin/String|): R|kotlin/String| <kind=EXACTLY_ONCE> {
|
||||
^ R|/bar|(R|<local>/result|)
|
||||
}
|
||||
) }
|
||||
}
|
||||
) }
|
||||
}
|
||||
public final fun bar(x: R|kotlin/String|): R|kotlin/String| {
|
||||
^bar R|<local>/x|
|
||||
}
|
||||
Reference in New Issue
Block a user