-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix exponential type checking of tuple literals. #15419
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
@swift-ci Please smoke test |
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.
Nice! Very easy win
@swift-ci Please smoke test |
Oops, need to move the fixed perf test over as well. |
This fixes two easy cases where we would go exponential in type checking tuple literals. Instead of generating a conversion to a single type variable (which results in one large constraint system), we generate a conversion ot the same type that appears in the initializer expression (which for tuples is a tuple type, which naturally splits the constraint system). I experimented with trying to generalize this further, but ran into problems getting it working, so for now this will have to do. Fixes rdar://problem/20233198.
@swift-ci Please smoke test |
@swift-ci Please smoke test Linux platform |
@swift-ci Please clean smoke test Linux platform |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
Source compat failure is also happening without my changes. |
Hi @rudkx – A question for you about the changes to the |
As I understand it, weak variables must be optional because they are reference types, but do not form strong references; i.e. the object they refer to can be released as a result of all the strong references going out of scope (or being released). When that happens, they are nil'ed out. |
I understand how weak references work. Can you just review #15540 instead? Thanks! :-) |
…king [Sema] NFC - Make #15419 work with weak vars
This fixes two easy cases where we would go exponential in type
checking tuple literals.
Instead of generating a conversion to a single type variable (which
results in one large constraint system), we generate a conversion ot
the same type that appears in the initializer expression (which for
tuples is a tuple type, which naturally splits the constraint system).
I experimented with trying to generalize this further, but ran into
problems getting it working, so for now this will have to do.
Fixes rdar://problem/20233198.