Swift: spurious(?) protocol non-conformance error

Originator:garth
Number:rdar://19865804 Date Originated:17-Feb-2015 02:16 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.3b1
Classification:Other Bug Reproducible:Always
 
I’m not sure this is a bug, but the following code yields the error shown.

protocol Delegate {
    typealias StateType
    var someClass: SomeClass<Self>? { get set }
}

class SomeClass<D: Delegate> {}

// Error: Type 'SomeDelegate' does not conform to protocol 'Delegate'
final class SomeDelegate: Delegate {
    typealias StateType = Int
    var someClass: SomeClass<SomeDelegate>?
}

The issue is peculiar because the error report depends on the definition of class SomeClass; if it is defined as just SomeClass<D> with no qualification on the type of D, then the compiler no longer reports that SomeDelegate does not conform to Delegate.

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!