[swift-evolution] [Discussion] Seal `T.Type` into `Type<T>`
antonyzhilin at gmail.com
Sat Jul 16 03:53:41 CDT 2016
I took some time to overview the whole idea in general, and I must say
(surprisingly) that I don't support it myself.
* Metatypes are still in the language; it turned out that they *must*
remain in the language
* The new primary `Type<T>` struct duplicates semantics and interface of
* But it cannot get extensive native support, so it uses `init?(casting:)`
instead of `as` cast, `is(_:)` method instead of `is`, etc
* `Type<T>` does not add new possibilities right now, although the proposal
promises to add reflection to `Type<T>` in the future
* `Mirror` already does reflection. It wraps `Any.Type` statically, which
is a simpler and more suitable model for reflection
I started thinking in a completely different direction:
* Rename metatypes `T.Type` to `Type<T>`
* Rename `T.self` to `T`
* Allow `Type<Type<T>>`
* **Extend `Mirror`** for Swift 4
What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution