-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Tweak the generic operator partition heuristic. #35725
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
disjunction conforms to a known protocol, grab its fixed type.
@swift-ci please test source compatibility |
@swift-ci please smoke test compiler performance |
@swift-ci please smoke test |
@swift-ci please test compiler performance |
Compilation-performance test failed |
1 similar comment
Compilation-performance test failed |
@swift-ci please test source compatibility |
@swift-ci please smoke test |
@swift-ci please smoke test compiler performance |
Looks like a bunch of source compat projects are failing an assertion after the frontend, but no failures in the type checker |
Before checking if an argument type to an applied disjunction conforms to a known protocol, grab its fixed type. This helps in cases where the argument type is a type variable, but the solver has already bound the type variable to a conforming type, e.g.
Array
. For example:When the solver gets to the generic operator overload partition for
+
, it knows to attempt theSequence
overloads first because it already knows the result of.map
is an array (andmap
is bound first because there are fewer overloads).I haven't added a test because this case still doesn't scale well, but this fix mitigates the impact of changing overload binding order from #35025. Cases like this only happened to compile before because the solver happened to attempt
Array.+
first.Resolves: rdar://73892488