is it possible to call an infix function on `this`...
# language-proposals
n
is it possible to call an infix function on
this
? I'm trying to create a DSL, with something like the following:
Copy code
fun test(init: Test.() -> Unit) : Test {
    return Test().apply { init() }
}

class Test {
    private var v = 0

    infix fun add(value: Int) {
        v+=value
    }
}

fun main(args: Array<String>) {
    test {
        add 3
        add 6
    }
}
Unfortunately, it only recognizes the
add 3
if I put
this
in front of it:
Copy code
test {
    this add 3
}
What is the reason this is necessary?