How do I tear off a function from the companion ob...
# announcements
s
How do I tear off a function from the companion object of a class? I'd expect this to work:
Copy code
fun main() {
    listOf("yes", "no").filter(SomeClass::filterYes).forEach{
        println(it)
    }
}

class SomeClass {
    companion object {
        fun filterYes(str: String) = str == "yes"
    }
}
but it doesn't. You can try it here: https://pl.kotl.in/sHlk5l7V0
figured it out!
SomeClass.Companion::filterYes
👍 2
r
i was going to tell you that , good you found it
👍 1