Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-2484] Bad diagnostic for incorrectly calling private init #45089

Closed
jadengeller mannequin opened this issue Aug 25, 2016 · 9 comments
Closed

[SR-2484] Bad diagnostic for incorrectly calling private init #45089

jadengeller mannequin opened this issue Aug 25, 2016 · 9 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation

Comments

@jadengeller
Copy link
Mannequin

jadengeller mannequin commented Aug 25, 2016

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()
    }
}
@belkadan
Copy link
Contributor

The override doesn't actually change anything. private is private either way.

@jadengeller
Copy link
Mannequin Author

jadengeller mannequin commented Aug 25, 2016

Yes, but you get the correct diagnostic once marked `override`.

@belkadan
Copy link
Contributor

Hm, I don't (with master).

@jadengeller
Copy link
Mannequin Author

jadengeller mannequin commented Aug 25, 2016

I guess it was fixed then? The attached screenshot shows the diagnostic in the latest beta.

@belkadan
Copy link
Contributor

No, I mean I get the bad diagnostic in both cases.

@jadengeller
Copy link
Mannequin Author

jadengeller mannequin commented Aug 25, 2016

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).

@rudkx
Copy link
Member

rudkx commented Oct 14, 2016

There's a PR for this under view: #5237

@rudkx
Copy link
Member

rudkx commented Oct 18, 2016

Merged:f72576d

@rudkx
Copy link
Member

rudkx commented Oct 18, 2016

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.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation
Projects
None yet
Development

No branches or pull requests

2 participants