See <https://kotlinlang.org/docs/reference/object-...
# language-proposals
k
See https://kotlinlang.org/docs/reference/object-declarations.html, notably this paragraph:
Note that anonymous objects can be used as types only in local and private declarations. If you use an anonymous object as a return type of a public function or the type of a public property, the actual type of that function or property will be the declared supertype of the anonymous object, or
Any
if you didn't declare any supertype. Members added in the anonymous object will not be accessible.
🤔 1
g
It seems to me its doing some neat union-typing there, but I dont think it'l give you access to a function declared on an anonymous type