SI-7818 Cast our way out of extended existential angst #2916
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.
substituteSymbols
is not sophisticated enough tooperate on
TypeSkolem
-s which are based on one of the"from" symbols.
The pertinant usage of
substituteSymbols
for this bug inin
Extender
. Recapping on that transform:Where
<rhs'>
has been subtituted with, among other things,[T, U] ~> [T', U']
.In this case our expected type contains a new type parameter
(of the extension method), whereas the type of the RHS contains
an existential skolem still pinned to the corresponding class type
parameter.
The limitation of substution is lamented in the comments
of
adaptMismatchedSkolems
, which faces the harder version ofthe issue where the skolems are in the expected type.
But, we're in the "easy" case with the skolems in the tree's type;
we can cast our way out of the problem.
Review by @adriaanm, /cc @odersky