dynamic behavior fixed, publishing the snapshot

This commit is contained in:
Sergey Chernov 2026-02-20 11:15:35 +03:00
parent 87ef1c38b8
commit c46f74bd7e
2 changed files with 27 additions and 1 deletions

View File

@ -21,7 +21,7 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
group = "net.sergeych"
version = "1.5.1-SNAPSHOT"
version = "1.5.0-SNAPSHOT"
// Removed legacy buildscript classpath declarations; plugins are applied via the plugins DSL below

View File

@ -209,6 +209,32 @@ class BindingTest {
ms.eval("""
""")
}
@Test
fun testDynamicToDynamicFun() = runTest {
val ms = Script.newScope()
ms.eval("""
class A(prefix) {
val da = dynamic {
get { name -> { x -> "a:"+prefix+":"+name+"/"+x } }
}
}
val B: A = dynamic {
get { p -> A(p) }
}
assertEquals(A("bar").da.foo("buzz"), "a:bar:foo/buzz")
assertEquals( B.buzz.da.foo("42"), "a:buzz:foo/42" )
val C = dynamic {
get { p -> A(p).da }
}
assertEquals(C.buzz.foo("one"), "a:buzz:foo/one")
""".trimIndent())
ms.eval("""
""")
}
}