Just out of curiosity, why is this a thing ? ``` ...
# announcements
b
Just out of curiosity, why is this a thing ?
Copy code
infix fun <T> Any.go(block: (T) -> Unit) {

    }

    fun main() {
        // Valid
        "".go<String> {

        }
        // Invalid
        "" go <String> {

        }
    }
p
If you want to use infix call you can write:
Copy code
"" go { x: String ->

}
šŸ‘ 1
b
Indeed, but what about this?
Copy code
infix fun <T> Any.go(block: T.() -> Unit) {

}
s
What about it? What exactly are you trying to do?
You can maybe make this a bit more convenient to write with a definition like this
Copy code
infix fun <T : Any> T.go(block: (T) -> Unit { }

"" go {

}
b
I'm not trying to do anything particular I was just wondering how to specify the generic type on an infix function