[SR-6928] Bad error message when mixing operators #49476
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
NA
Additional Detail from JIRA
md5: 78ea10ca49c4c971a8f1e189eeacd02a
Issue Description:
Here is a simple repro: https://gist.github.com/jlongster/a1b9405ce4ee9360254cbfb35e8b7013
Running that code gives an error: "Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions"
The real error should be `Binary operator '*' cannot be applied to operands of type 'Int' and 'Double'`, and the fix is using `Double(index)` instead of just `index`. The above error message is strange given that it's not that complex of an expression.
The text was updated successfully, but these errors were encountered: