fixed inline map splats expansion in function calls
This commit is contained in:
1 parent
f6d51e9b94
commit
3dfe98a93d
2 files changed
+15
-2
No files matched your search
@@ -4284,4 +4284,17 @@ class ScriptTest {
|
||||
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testAutoSplatArgs() = runTest {
|
||||
eval("""
|
||||
fun tf(x, y, z) {
|
||||
"x=%s, y=%s, z=%s"(x,y,z)
|
||||
}
|
||||
assertEquals(tf(1, 2, 3), "x=1, y=2, z=3")
|
||||
val a = { x: 3, y: 4, z: 5 }
|
||||
assertEquals(tf(...a), "x=3, y=4, z=5")
|
||||
assertEquals(tf(...{ x: 3, y: 4, z: 50 }), "x=3, y=4, z=50")
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user