-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Cache expression types in failure diagnosis. #7481
Conversation
@swift-ci Please smoke test |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please smoke test |
After we call into typeCheckExpression() we need to cache the resulting types in the constraint system type map because we later call into code that reads the types out of the type map. Fixes rdar://problem/30376186 as well as a couple crashers.
Would it be better if type checking a subexpression returned a new map that we can merge in instead of writing back to the expr and reading out? |
It's crossed my mind. At the very least the places we're doing this should be refactored into common code under ConstraintSystem, and when I get more time to do more extensive refactoring I'll be doing that. |
@swift-ci Please smoke test |
@swift-ci Please smoke test and merge |
Looks good -- looking forward to more crashers being fixed in this area :) It would be nice to have a test case that's not a compiler crasher, but if it's tricky to derive one don't bother. |
@swift-ci Please smoke test |
👏 |
Cache expression types after type checking smaller portions of an expression. The types need to be in the constraint system's type map when we call into other code that attempts to read the types out from the map.