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-15273] Fix-it is incorrectly applied to public type declaration that lacks a public init required by protocol conformance #57595

Closed
WowbaggersLiquidLunch opened this issue Oct 2, 2021 · 1 comment
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

@WowbaggersLiquidLunch
Copy link
Collaborator

Previous ID SR-15273
Radar None
Original Reporter @WowbaggersLiquidLunch
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS 12.0 Beta (21A5534d)
Xcode 13.0 (13A233)
Swift 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1) and Swift development snapshot 2021-09-28

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee @LucianoPAlmeida
Priority Medium

md5: 6007729760dc2cc872d42014b9b2419a

Issue Description:

buggy code that produces the error and fix-it:

public protocol PublicInitable {
    init()
}

public struct Buggy: PublicInitable {
// error: initializer 'init()' must be declared public because it matches a requirement in public protocol 'PublicInitable'
// fix-it: mark the initializer as 'public' to satisfy the requirement
}

after applying the fix-it:

public protocol PublicInitable {
    init()
}

public struct public Buggy: PublicInitable {
}

Attached are a screen recording of this bug occurring in Xcode, and a zip of the source code that produces this bug.

@LucianoPAlmeida
Copy link
Collaborator

Fixed by #40892

@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