-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Don’t repeat lookup work that may not round-trip #85517
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
|
@slavapestov I think you might be the best person to review this. |
|
@swift-ci please smoke test |
nkcsgexi
left a comment
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.
❤️
|
Looks like we've fixed a compiler crasher with this diff: |
slavapestov
left a comment
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.
Sure, that’s reasonable. FWIW I’d like to get rid of the bound decl entirely at some point. Caching the result of these lookups is best handled at higher levels.
66a2d6c to
22477f2
Compare
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
validation-test/compiler_crashers/RequirementMachine-areReducedTypeParametersEqual-1801de.swift
Show resolved
Hide resolved
When a DeclRefTypeRepr is bound to a known declaration, the exact DeclNameRef used to create it is erased. This means that we no longer know exactly which module selector was used in the source code, so repeating the lookup with the same instance might produce different results. Avoid this problem by reusing the bound decl instead of trying to look up the same declaration again. Fixes rdar://164647850.
22477f2 to
b9747b7
Compare
|
@swift-ci please smoke test |
3 similar comments
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
When a DeclRefTypeRepr is bound to a known declaration, the exact DeclNameRef used to create it is erased. This means that we no longer know exactly which module selector was used in the source code, so repeating the lookup with the same instance might produce different results.
Avoid this problem by reusing the bound decl instead of trying to look up the same declaration again.
Fixes rdar://164647850.