has there been a proposal to allow us to use a `ty...
# language-proposals
z
has there been a proposal to allow us to use a
typealias
as a namespace?
Copy code
typealias MainViewModel = ViewModel<State>
Then I’d like to have classes defined as:
Copy code
MainViewModel.State
2
b
I use this at work often, in Swift. It requires that
State
is already nested within
ViewModel
, but other than that the type alias inherits all the syntax of the original type
z
I think in Swift you can add nested classes to another class in a different file. Is this true?
b
@zak.taccardi That is true, as well as nested enums, structs, protocols, and typealiases. Any type can be later nested within any other