-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Relax the left-over information check in ComponentStep
#38770
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
…tStep` Instead of crashing in release builds, let's simplify fail the step and let type-checker produce a fallback diagnostic. Maintain a trap in debug builds to make it easier to investigate the root cause of the issue. Resolves: rdar://56167233
…ce it's handle gracefully
@hamishknight I have removed redundant check you mentioned and added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to produce an error message instead 👍
@swift-ci please smoke test |
@hamishknight @hborla After thinking about this some more I think we can drop abort blocks all together because there it would be impossible now to miscompile, WDYT? |
…pt to solve should fail As soon as `InvalidState` flag is set solving of the constraint system as aborted and all subsequent calls to `solveImpl` would produce no solutions.
@xedin Yeah, I think it's fine to always report the error message instead of aborting. If we still want it to crash in this part of the code in a debug build, we could just put in an assert |
… state Setting `InvalidState` already makes sure that there is no possibility of miscompile.
@swift-ci please smoke test |
Adjusted that, for debugging it would print the constraints in question so I just removed NDEBUG blocks. |
I'd prefer if we crashed in a debug build to make it loud and obvious that we have a logic error, but yeah that could be done with an assert. |
I think asking to file a bug is loud enough, that would also indicate where the error is better than crash report because not all tools capture stacktraces. |
Hmm, won't we emit "type of expression is ambiguous without more context" for an expression with no solutions? |
…ia fallback diagnostic
Ugh, you are right! I have completely forgot about that message assuming that |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please smoke test |
Instead of crashing in release builds, let's simply fail the
step and let type-checker produce a fallback diagnostic.
Resolves: rdar://56167233