-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Reword the "expression too complex" error not to blame the user. #14391
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
Conversation
It's not you, it's us. We shouldn't tell the user their code is too complex, and "solve" doesn't mean anything to them in this context. Make it clearer this is an implementation limitation.
@swift-ci Please smoke test |
@jrose-apple How does this sound to you? |
|
A classic error though; I'll miss its capricious appearances. |
@xwu Well, it's still on us to eventually make this error completely unnecessary… |
Good fix. In a moment of frustration, anything to help defuse the issue of what is going on is helpful to get the user out of anger mode and back into problem solving mode. Beyond overall just working on making the compiler able to handle complexity, specific user-achievable fixes would be appreciated. This is especially true for people without CS degrees and for people whom Swift is just one of many languages they have to do their job in. Sometimes, the issue is they don't understand parsing well enough to begin to fix this error, so randomly go around changing things trying to make it work. More information or tooling on specific solutions would go a long way. Here are some rough examples you might use to do this.
|
If I'm grammar-nitpicking, I'd say I'd prefer the past tense of the original ("was" instead of "is"), and the second "the expression" should just be "it" ("try breaking it up…"). Per @kdawgwilk's comment, I actually like having "the compiler" in there, even if it is redundant and makes the message longer. It underscores the part you're trying to get across, that it's not an inherent limitation of the language. I like the idea behind @langford's further improvements but I think that can be separate PRs, and probably needs more help from @xedin and @rudkx. |
@jrose-apple The antecedent to "it" feels ambiguous to me in that case; does it mean "the compiler" or "the expression"? |
*shrug* That's fair. For me "sub-expressions" is a strong enough indicator that the "it" refers to the expression. |
This broke in CI. You missed a bunch of tests in validation-test/Sema/type_checker_perf/slow/. |
Thanks Greg, #14509 should sort that out. |
Ah, it's cause they're marked |
The issue is that the scale tests run in PR testing, but the tests that use an actual timer only run for release/no-asserts build, and those don't run in PR testing. It might not be the right tradeoff, but at the time we felt like some testing of these tests (which we weren't able to fit into the scale-test model) were better than none. |
…ble-time Update validation tests for diagnostic message change from #14391.
It's not you, it's us. We shouldn't tell the user their code is too complex, and "solve" doesn't mean anything to them in this context. Make it clearer this is an implementation limitation.