Swift 2: Typed partial application of protocol method results in bizarre error
| Originator: | rix.rob | ||
| Number: | rdar://21289690 | Date Originated: | 08-Jun-2015 05:49 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-7-beta (7A120f) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
I don’t actually expect this to succeed, but I do expect a better error message.
Steps to Reproduce:
protocol P {
func f(x: Int) -> Int
}
struct S: P {
func f(x: Int) -> Int { return x }
}
let f: S -> Int -> Int = P.f
Expected Results:
An error telling me what I did wrong, and perhaps suggesting I use S.f instead of P.f.
Actual Results:
Implementation details \o/
./partial.swift:11:28: error: 'S' is not a subtype of '@opened("EF607398-0E27-11E5-9EAE-3C15C2E88098") P'
let f: S -> Int -> Int = P.f
Regression:
N/A
Notes:
N/A
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!