-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Receivers of nested inline functions correctly resolved by the JS tra…
…nsformer (#175)
- Loading branch information
1 parent
d5c5580
commit 5482b8b
Showing
2 changed files
with
27 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
21 changes: 21 additions & 0 deletions
21
atomicfu/src/commonTest/kotlin/kotlinx/atomicfu/test/NestedInlineFunctionsTest.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,21 @@ | ||
package kotlinx.atomicfu.test | ||
|
||
import kotlinx.atomicfu.* | ||
import kotlin.test.* | ||
|
||
// Ensures that inline function receivers are resolved correctly by the JS transformer | ||
class NestedInlineFunctionsTest { | ||
val _a = atomic(5) | ||
val _b = atomic(42) | ||
|
||
@Test | ||
fun testNestedInlineFunctions() { | ||
_a.loop { a -> | ||
_b.loop { b -> | ||
assertEquals(5, a) | ||
assertEquals(42, b) | ||
return | ||
} | ||
} | ||
} | ||
} |