-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[K/JS] Fix autoboxing for inlined function ^KT-60785 Fixed
- Loading branch information
1 parent
5801279
commit b925404
Showing
7 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/BoxJsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsBoxTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsES6TestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
js/js.translator/testData/box/coroutines/boxingUnboxingInsideTheSuspendFunction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// WITH_STDLIB | ||
// EXPECTED_REACHABLE_NODES: 1292 | ||
// KT-60785 | ||
|
||
import kotlin.coroutines.* | ||
import kotlin.coroutines.intrinsics.* | ||
|
||
value class SomeValue(val a: String) { | ||
override fun toString() = when (a) { | ||
"fa" -> "O" | ||
"il" -> "K" | ||
else -> "" | ||
} | ||
} | ||
|
||
suspend fun foo() = mapOf(SomeValue("fa") to SomeValue("il")) | ||
|
||
fun builder(c: suspend () -> Unit) { | ||
c.startCoroutine(object : Continuation<Unit> { | ||
override val context = EmptyCoroutineContext | ||
override fun resumeWith(result: Result<Unit>) {} | ||
}) | ||
} | ||
|
||
fun box(): String { | ||
var result = "" | ||
|
||
builder { | ||
for ((k, v) in foo()) { | ||
result += "$k$v" | ||
} | ||
} | ||
|
||
return result | ||
} |