-   Notifications  
You must be signed in to change notification settings  - Fork 10.6k
 
Open
Labels
bugA 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 itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationextensionFeature → declarations: `extension` declarationsFeature → declarations: `extension` declarationsgood first issueGood for newcomersGood for newcomersinheritanceFeature → type declarations → class: Subclassing and inheritance of class membersFeature → type declarations → class: Subclassing and inheritance of class membersswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
The following errors are misleading and could use a rewording as clear language rules, depending on the kinds of extended and inherited types.
protocol P {} struct S {} class C1 {} class C2 {} extension C2: S {} // error: inheritance from non-protocol type 'S' extension C2: C1 {} // error: inheritance from non-protocol type 'C1' extension C2: C1 & P {} // error: inheritance from class-constrained protocol composition type 'C1 & P'Environment
- Swift version 5.9-dev (LLVM 6a04c4848990c70, Swift c1d5118)
 
NB: How to improve on these is left as an exercise to whoever takes the issue.
Metadata
Metadata
Assignees
Labels
bugA 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 itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationextensionFeature → declarations: `extension` declarationsFeature → declarations: `extension` declarationsgood first issueGood for newcomersGood for newcomersinheritanceFeature → type declarations → class: Subclassing and inheritance of class membersFeature → type declarations → class: Subclassing and inheritance of class membersswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis