Protocol extension with function returning its associated type fails to compile when its associated type is typealiased using `=`
| Originator: | matteo.battaglio | ||
| Number: | rdar://21941505 | Date Originated: | 2015/07/22 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 7 beta 4 |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
The following code should be legal in Swift 2, but fails to compile.
protocol AType {
func f() -> Self
}
protocol BType {
typealias A = AType
func foo() -> A
func bar() -> A
}
extension BType {
func bar() -> A {
return foo().f()
}
}
Steps to Reproduce:
Expected Results:
The code compiles.
Actual Results:
The code does not compile, complaining with "Cannot invoke 'f' with no arguments".
Version:
Xcode 7 beta 4
Notes:
Changing the line `typealias A = AType` to `typealias A: AType` makes it successfully compile.
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!