[SR-2484] Bad diagnostic for incorrectly calling private init
| Previous ID | SR-2484 |
| Radar | None |
| Original Reporter | @jadengeller |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Attachment: Download
Environment
Swift 3, beta 6
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug, DiagnosticsQoI |
| Assignee | @jadengeller |
| Priority | Medium |
md5: 48481479ceefe5c851145b6a83845eec
relates to:
- SR-3236 Bogus diagnostics for referencing ".init" on instances
Issue Description:
"`super.init` cannot be called outside the initializer", in the initializer
class Object {
private init() {
}
}
class Foo: Object {
init() {
super.init()
}
}
The override doesn't actually change anything. private is private either way.
Yes, but you get the correct diagnostic once marked `override`.
Hm, I don't (with master).
I guess it was fixed then? The attached screenshot shows the diagnostic in the latest beta.
No, I mean I get the bad diagnostic in both cases.
Oh, it does look like that's true. At least in that case you also get another diagnostic so yo know things are broken. Without override, a user might be very confused (especially since the behavior of `private` changed).
There's a PR for this under view: https://github.com/apple/swift/pull/5237
Please verify with a build that includes the fix and then close if you agree the issue is fixed. Re-open if the issue is not fixed, or open a new ticket if you find a new issue.