dynamic behavior fixed, publishing the snapshot
This commit is contained in:
parent
87ef1c38b8
commit
c46f74bd7e
@ -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
|
||||
|
||||
|
||||
@ -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("""
|
||||
""")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user