FIR DFA: correct exit node retrieval when a safe call is the last expression
^KT-44699 Fixed
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
266432a482
commit
83e3201677
+1
-1
@@ -1,7 +1,7 @@
|
||||
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>/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|SubstitutionOverride<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|)
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -11,7 +11,7 @@ FILE: coercionToUnitWithEarlyReturn.kt
|
||||
public final fun foo(x: R|() -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun main(x: R|A?|): R|kotlin/Unit| {
|
||||
lval lambda: R|() -> kotlin/Unit| = l@fun <anonymous>(): R|kotlin/Unit| {
|
||||
lval lambda: R|() -> kotlin/Unit?| = l@fun <anonymous>(): R|kotlin/Unit?| {
|
||||
when () {
|
||||
==(R|<local>/x|?.{ $subj$.R|kotlin/Any.hashCode|() }, Int(0)) -> {
|
||||
^@l Unit
|
||||
@@ -21,5 +21,5 @@ FILE: coercionToUnitWithEarlyReturn.kt
|
||||
^ R|<local>/x|?.{ $subj$.R|/A.unit|() }
|
||||
}
|
||||
|
||||
R|/foo|(R|<local>/lambda|)
|
||||
<Inapplicable(INAPPLICABLE): /foo>#(R|<local>/lambda|)
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,5 +15,5 @@ fun main(x: A?) {
|
||||
}
|
||||
|
||||
// lambda has a type (() -> Unit?)
|
||||
foo(lambda)
|
||||
<!INAPPLICABLE_CANDIDATE{LT}!><!INAPPLICABLE_CANDIDATE{PSI}!>foo<!>(lambda)<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user