Pmc: Treat `x ~ y @ty` the same as `x ~ y` (#23145)
In #23145 we had a desugaring that matched on expressions ds @Any
and ds @blah
(where blah /= Any
). In both cases, we match on the
same value, but Long-distance information was unable to figure this
out.
The fix is rather simple: Upon reasoning about the Core constraint
x ~ ds @Any
, drop any type arguments to see x ~ ds
, then we will
equate that to the same as ds @blah
.
This plays a bit fast-and-loose with types; on the other hand, the situations in which can give the same value different types should be exceedingly rare.
Fixes #23145.