holgerbrandl
05/28/2016, 11:14 AMclass Dummy <T> (val data: Collection<T>){
infix operator fun invoke(el:T) : Boolean{
return data.contains(el)
}
}
fun main(args: Array<String>) {
val dummy = Dummy(listOf("a", "b", "c"))
dummy("a") // works
dummy "a" // does not work
}
From what I understand all 3 conditions for infixing should be met (see https://kotlinlang.org/docs/reference/functions.html#infix-notation)