[swift-evolution] [Discussion] Seal `T.Type` into `Type<T>`

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Jul 15 06:18:18 CDT 2016


I’m glad Brent could reach out to you what I tried so hard. :)

I’ve been working on non-string VFL (Visual Format Language) for iOS Autolayout constraints.

Formula.Horizontal << |-view.size(==20)-(constant: 0, option: .Center)-otherView-| << [.AlignAllTop, .AlignAllBottom]

Something like this is only made possible with some custom operators and metatype magic for api design. (Project is not finished yet.)

I’ll come back to size etc. later when I found some time to dig into that issue.

_uniqueIdentifier is used to identify the right metatype which is downcasted to Any in _underlyingMetatype. It also reduces the amount of recalculations of that value from the hashValue property. Besides that the implementation of hashValue might change one day!?



-- 
Adrian Zubarev
Sent with Airmail

Am 15. Juli 2016 um 11:28:24, Anton Zhilin (antonyzhilin at gmail.com) schrieb:

I finally could understand what metatypes can do and Type<T> cannot, namely dynamic dispatch of static/class methods.
If that usage is important enough, then I'm for leaving (sealed) T.Typebecause of that feature.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160715/d20a2cc9/attachment.html>


More information about the swift-evolution mailing list