Declaring a "static" function in Kotlin is done using:
companion object {
fun classFoo() {
//do something
}
}
However I was mistakenly coding
companion object fun classFoo() {
//do something
}
Expecting the code to do the same, if only one static function was required.
The compiler doesn't argue about that, and it seems to be valid as the compiler expects a fun
name and parameters. But I never found how to call that function from other class.
What does that form of companion object fun
do? there is no doc available about that.