[SR-9040] Suggestion when overriding implictly unwrapped optional does not suggest making parameter implictly unwrapped #51543
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
Environment
Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.0.0
Additional Detail from JIRA
md5: 9b7c61d5cf17e72eb3e9d8e02cd54d9f
Issue Description:
When overriding a function that has an implicitly unwrapped optional parameter with a non-optional parameter, the fixit suggests adding
?
, making the parameter optional.I would expect this to offer adding
!
, along with?
, but I am not sure if this is classed as a bug, or an intentional change due to SE-0054.Example code that produces the fixit:
This produces the message:
Cannot override instance method parameter of type 'String?' with non-optional type 'String'
, with anInsert '?'
fix.If this is classed as a bug I'd love to attempt to fix it![]( (if it's not, sorry))
The text was updated successfully, but these errors were encountered: