- 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 Implementationopaque result typesFeature → types → opaque types: opaque result typesFeature → types → opaque types: opaque result typesopaque typesFeature → types: opaque typesFeature → types: opaque typesoverrideFeature: Overriding in classesFeature: Overriding in classesswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Description
I imagine this is a limitation and these methods can't be overridden, but it's hard to tell with the bad diagnostic message.
Reproduction
protocol P {} struct A1: P {} struct A2: P {} class C { func f() -> some P { A1() } } class D: C { // Error: Method does not override any method from its superclass override func f() -> some P { A2() } }Expected behavior
An actual error explaining why this isn't possible.
Environment
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
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 Implementationopaque result typesFeature → types → opaque types: opaque result typesFeature → types → opaque types: opaque result typesopaque typesFeature → types: opaque typesFeature → types: opaque typesoverrideFeature: Overriding in classesFeature: Overriding in classesswift 6.0type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis