[SR-13515] Incorrect fix-it when attempting to extend an objc
protocol with a default implementation
#55951
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
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: 1e0dc6ae6b02f489a3c7f3c42370108b
Issue Description:
@objc
protocols don't support default implementations for methods via extensions. Attempting to do so makes the compiler suggest that you add the@objc
attribute to your default method implementation, which instead it should tell you that the entire construct is invalid.Example code:
Error:
If you follow the fix-it, you another error which correctly tells you that this is invalid. But strangely, you still get a suggestion to add
@objc
:The text was updated successfully, but these errors were encountered: