Feature request: `typealias` to allow access to `companion object`

This doesn’t work:

typealias A = B
class B { companion object { fun foo(){} } }
A.foo()

Which is a pity, as it prevents typealias to be used to provide backwards compatibility for renamed or moved classes.

Could Kotlin support access to companion object through the alias?

If not, why?
Thanks for considering.

1 Like