Sema: Don't attempt deep equality if we're also attempting optional-to-optional #78958
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When solving a conversion between two optional types, for example
Optional<$T1>
andOptional<$T2>
, we would introduce a disjunction with three choices:$T1
and$T2
$T1
to$T2
$T2
toOptional<$T1>
.However, the first one is actually redundant, because any situation where it leads to a solution, the second choice will also lead to a solution. This is inefficient because it results in repeated work in the solver. The first choice was "favored", meaning if it succeeds we would skip the others, which partially mitigated the overhead. However, if we're exploring a dead end in the solution space, we would attempt all three choices, when it would suffice to attempt two.
A new
-disable-optimized-restrictions
flag turns off the new behavior. I plan on removing this flag as soon as possible. I will also make a similar change to array conversions shortly.