// this is the class from the DSL class X { fun writeInt(i:Int) = println(i) } data class PredefinedInt( val i : Int ) { operator fun X.invoke() = writeInt(i) } val number5 = PredefinedInt(5) fun workOnX2() : X.() -> Unit = { writeInt(1) // ok number5 // ok // this is what I actually want to do number5() // error: invoke() not found // this is what I would expect to be possible this() // error: invoke() not found }