-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Labels
access controlFeature → modifiers: Access control and access levelsFeature → modifiers: Access control and access levelsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconformancesFeature → protocol: protocol conformancesFeature → protocol: protocol conformancesdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationfix-itsFeature: diagnostic fix-itsFeature: diagnostic fix-itsgood first issueGood for newcomersGood for newcomersmemberwise initFeature: Memberwise structure initializersFeature: Memberwise structure initializersswift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Description
No response
Reproduction
public struct Number: RawRepresentable {
public let rawValue: Int
}
398 | public struct Number: RawRepresentable {
| `- error: initializer 'init(rawValue:)' must be declared public because it matches a requirement in public protocol 'RawRepresentable' [witness_not_accessible_proto]
399 | public let rawValue: Int
400 | }
Expected behavior
This diagnostic is not great:
- What initializer? (The implicit memberwise initializer).
- How do I or can I at all declare it public? (An implicit memberwise initializer cannot be public).
- What should I do to make this work? (Declare an explicit initializer + fix-it).
Environment
Swift version 6.2-dev (LLVM 1a588e5b044c46f, Swift 55189ba)
Additional information
No response
Metadata
Metadata
Assignees
Labels
access controlFeature → modifiers: Access control and access levelsFeature → modifiers: Access control and access levelsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconformancesFeature → protocol: protocol conformancesFeature → protocol: protocol conformancesdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationfix-itsFeature: diagnostic fix-itsFeature: diagnostic fix-itsgood first issueGood for newcomersGood for newcomersmemberwise initFeature: Memberwise structure initializersFeature: Memberwise structure initializersswift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis