[SR-13701] Confusing errors (involving inout + closure + rethrows) after applying swiftc fix-it #56099
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: cfb42507db3efad1ced5dac773dab076
Issue Description:
The following (incorrect) code
… produces the following error:
The error message is correct as is, but could be made more helpful by suggesting to move
inout
into(Self)
(i.e.(inout Self)
).The code is admittedly silly (or at least ambiguous), but swiftc suggested changing my initial
to above code, which is what brought me there in the first place.
Since I've never seen a closure be passed as
inout
I'd expect swiftc to suggest(inout Self) …
, instead ofinout (Self) …
.Especially since without the
&
ofclosure(&self)
the error becomes even more confusing:The text was updated successfully, but these errors were encountered: