Is this some wrong api translation or something?

extension String {

    /// The index type for subscripting a string.
    public typealias Index = String.CharacterView.Index

    /// A type used to represent the number of steps between two `String.Index`
    /// values, where one value is reachable from the other.
    ///
    /// In Swift, *reachability* refers to the ability to produce one value from
    /// the other through zero or more applications of `index(after:)`.
    public typealias IndexDistance = IndexDistance
IndexDistance = IndexDistance really?

Shouldn’t this look like

public typealias IndexDistance = public typealias IndexDistance = 
String.CharacterView.IndexDistance?
Don’t get me wrong, Xcode is able to tell me that by cmd+click in the right 
IndexDistance but this translation is ugly.

Otherwise I also could write

public typealias Index = Index
which looks very ugly.

Is this a bug? Current snapshot bug?
Should we propose for more consistency or is this something that the devs are 
working on?


-- 
Adrian Zubarev
Sent with Airmail
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to