[SR-11334] Misleading error message when a mutating getter is used in the definition of a getter #53735
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
Environment
Apple Swift version 5.1 (swiftlang-1100.0.257.2 clang-1100.0.31.3)
Additional Detail from JIRA
md5: e1dfed439a8936e45650002009419c47
Issue Description:
Consider this piece of code
Running this through
swiftc
will produces a highly confusing error message, complaining thatd
needs to be explicitly unwrapped, even though it has been force unwrapped at the definition:Only once
d[v]
is changed tod![v]
(which seems redundant), the error message reveals the true cause of failure:The text was updated successfully, but these errors were encountered: