Xcode-beta (7A152u): A typelias in Protocol are not matched correctly in extensions

Originator:owensd
Number:rdar://21807845 Date Originated:13-Jul-2015 08:32 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A152u)
Classification:Other Bug Reproducible:Always
 
Given this:

    protocol P {
        typealias Content : ExtensibleCollectionType
        typealias Index = Content.Index
        
        var c: Content { get }
        func f(n: Index)
    }

    extension P {
        func f(n: Index) {  // error
            if n == c.startIndex {
            }
        }
    }

Fails to compile, “Binary operator ‘==‘ cannot be applied to operands of type ‘Self.Index’ and ‘Self.Content.Index’.

However, this works:

    extension P {
        func f(n: Content.Index) {  // error
            if n == c.startIndex {
            }
        }
    }

Both should be equivalent.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!