[SR-9598] Confusing errors around dot-prefix and optional #52045
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
Environment
Swift 4.2
Additional Detail from JIRA
md5: 404f375953ec192e9ba72327dc495c98
Issue Description:
Given the following code:
The final line returns the error:
This makes sense upon closer examination, though with how much optional sugar is mixed into the language, I'd hope at the very least for some better error messaging when Swift can detect the discrepancy around optionals, and maybe a fix-it to unwrap
bar
in the above case.The text was updated successfully, but these errors were encountered: