You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix bounds of encoded type variables in quote patterns
When we encode quote patterns into `unapply` methods, we need to create
a copy of each type variable. One copy is kept within the quote(in the
next stage) and the other is used in the `unapply` method to define the
usual pattern type variables. When creating the latter we copied the
symbols but did not update the infos. This implies that if type variables
would be bounded by each other, the bounds of the copies would be the
original types instead of the copies. We need to update those references.
To update the info we now create all the symbols in one pass and the
update all their infos in a second pass. This also implies that we cannot
use the `newPatternBoundSymbol` to create the symbol as this constructor
will register the info into GADT bounds. Instead we use the plain
`newSymbol`. Then in the second pass, when we have updated the infos, we
register the symbol into GADT bounds.
Note that the code in the added test does compiles correctly, but it had
the inconsistent bounds. This test is added in case we need to manually
inspect the bounds latter. This test does fail to compile in
#17935 if this fix is not applied.
0 commit comments