Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6928] Bad error message when mixing operators #49476

Open
swift-ci opened this issue Feb 5, 2018 · 1 comment
Open

[SR-6928] Bad error message when mixing operators #49476

swift-ci opened this issue Feb 5, 2018 · 1 comment
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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 5, 2018

Previous ID SR-6928
Radar rdar://problem/37290901
Original Reporter jlongster (JIRA User)
Type Bug
Environment

NA

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee None
Priority Medium

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.

@jckarter
Copy link
Member

jckarter commented Feb 5, 2018

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants