[FIR] Add test for KT-49249
This commit is contained in:
committed by
Space Team
parent
019d7db737
commit
092ebf4c11
+20
@@ -0,0 +1,20 @@
|
||||
FILE: longElvisChain.kt
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
lval a: R|kotlin/Throwable?| = Null(null)
|
||||
lval b: R|kotlin/Unit?| = Null(null)
|
||||
lval c: R|kotlin/Throwable| = R|<local>/a| ?: R|<local>/b|?.{ $subj$.R|kotlin/let|<R|kotlin/Unit|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|kotlin/Unit|): R|kotlin/Nothing| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
^test_1 R|<local>/it|
|
||||
}
|
||||
) } ?: ^test_1 Unit
|
||||
R|<local>/c|!!
|
||||
throw R|<local>/a|
|
||||
}
|
||||
public final fun test_2(): R|kotlin/Unit| {
|
||||
lval a: R|kotlin/Throwable?| = Null(null)
|
||||
lval b: R|kotlin/Unit?| = Null(null)
|
||||
lval c: R|kotlin/Throwable| = R|<local>/a| ?: R|<local>/b|?.{ $subj$.R|kotlin/let|<R|kotlin/Unit|, R|kotlin/Nothing|>(<L> = let@fun <anonymous>(it: R|kotlin/Unit|): R|kotlin/Nothing| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
^test_2 R|<local>/it|
|
||||
}
|
||||
) } ?: ^test_2 Unit
|
||||
throw R|<local>/a|
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// ISSUE: KT-49249
|
||||
// WITH_STDLIB
|
||||
|
||||
fun test_1() {
|
||||
val a: Throwable? = null;
|
||||
val b: Unit? = null
|
||||
val c = a ?: b?.let { return it } ?: return
|
||||
c<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
throw <!TYPE_MISMATCH!>a<!>
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
val a: Throwable? = null;
|
||||
val b: Unit? = null
|
||||
val c = a ?: b?.let { return it } ?: return
|
||||
throw <!TYPE_MISMATCH!>a<!>
|
||||
}
|
||||
Reference in New Issue
Block a user