[SR-11104] Slightly misleading diagnostics for contextual failures with multiple fixes #53499
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 version 5.1-dev (LLVM 200186e28b, Swift 3954a4a)
Target: x86_64-apple-darwin18.5.0
Additional Detail from JIRA
md5: cadd30745722d9225de2ee4510bba974
Issue Description:
For the following code:
We emit these diagnostics:
While the second error is correct, the first error is a bit misleading as there's no
Int?
expression written in the user's code. This is happening because after applying the collection element mismatch fix, we go onto assume that the array is an[Int]
. While this is important in allowing us to end up with a fully solved constraint system, we should find a better way to present these diagnostics to the user.The text was updated successfully, but these errors were encountered: