[swift-evolution] [SE-0011] Re-considering the replacement keyword for "typealias"
Loïc Lecrenier
loiclecrenier at icloud.com
Sun Dec 20 04:54:19 CST 2015
-1
I understand the idea. But we would still need a replacement for “typealias” because “Element: typealias” says “Element is a type alias” and not “Element is an associated type”.
Also, it would be difficult to add inheritance clauses and default values.
“Element is an associated type that conforms to SequenceType, and is an Array of Int by default”
is currently
typealias Element : SequenceType = Array<Int>
but I don’t see how it could be written with your proposed syntax.
- Loïc
> On Dec 19, 2015, at 11:52 PM, Tino Heth <2th at gmx.de> wrote:
>
> Another spontaneous idea (not sure weather I actually like it — take it as brainstorming):
> Variable deklarations have the form
> thatIsTheName: ThatIsWhatIAm
> so the ambiguity could be resolved by
> ElementType: typealias
> which would say "ElementType is a associated type", like
> let i: Int
> says "i is an integer"
More information about the swift-evolution
mailing list