[SR-6207] Misleading error for unqualified use of static variable in method #48759
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
expressions
Feature: expressions
good first issue
Good for newcomers
static declarations
Feature → declarations: Static declarations
swift 6.0
type checker
Area → compiler: Semantic analysis
Environment
Swift 4
Additional Detail from JIRA
md5: 47c00d1618aecdca414e977e2fbf19c9
Issue Description:
The fixit helps, but it still isn't obvious what's going wrong. The compiler is acting like the use of
cvar
was writtenself.cvar
, and hints at this with "an instance of", but it's easy to gloss over the subtlety. The text could be tweaked, maybe likewhere the
X
is the relevant parent value. (e.g.self
for this case, orfoo.bar
forfoo.bar.cvar
).The text was updated successfully, but these errors were encountered: