Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for delegateClosureOf (0.17 sec)

  1. platforms/core-configuration/kotlin-dsl/src/test/kotlin/org/gradle/kotlin/dsl/GroovyInteroperabilityTest.kt

            val list = arrayListOf<Int>()
            delegateClosureOf<MutableList<Int>> { add(42) }.apply {
                delegate = list
                call()
            }
            assertEquals(42, list.first())
        }
    
        @Test
        fun `can use closure with a null delegate call`() {
            var passedIntoClosure: Any? = "Something non null"
            delegateClosureOf<Any?> { passedIntoClosure = this }.apply {
                delegate = null
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 08:06:49 UTC 2023
    - 10.1K bytes
    - Viewed (0)
Back to top