-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
assertion failed: unresolved symbols while pickling quote with type bounds #14708
Comments
At first glance of the stacktrace, it seems this is happening in the Pickler phase before the changes in the later phases of #12540. |
The unresolved symbol gets created in [[syntax trees at end of typer]] // i14708.scala
package <empty>#1677 {
import scala#25.quoted#422.*
final lazy module val Main#2822: Main#2823 = new Main#2823()
final module class Main#2823() extends Object() { this: Main#2822.type =>
def foo#6754(a#6786: quoted#422.Expr#4925[Any#456])(using
x$2#7232: quoted#422.Quotes#4937
): Unit#155 =
{
a#6786 match
{
case
x$2#7232.asInstanceOf#2632[
scala#25.quoted#422.runtime#4949.QuoteMatching#7251
].ExprMatch#7287.unapply#15094[Tuple1#302[t#14796 @ _],
(scala#25.quoted#422.Type#4943[t#14796],
scala#25.quoted#422.Expr#4925[Set[t#14796]]
)
](
Tuple2#135.unapply#13801[scala#25.quoted#422.Type#4943[t#14796]
,
scala#25.quoted#422.Expr#4925[Set[t#14796]]](
given t$given1#14935 @ _
, x#14936 @ _:scala#25.quoted#422.Expr#4925[Set#6796[t#14796]])
)(
'{
{
@patternType type t#14202
scala#25.quoted#422.runtime#4949.Patterns#7249.
patternHole#14206
[Set[t#14202]].toSet#14580[t$given1#14221.Underlying#14218]
}
}.apply#14273(x$2#7232)
)
=>
()
case _ =>
()
}
}
} Here, we do bind a |
After type checking we have ...
'{
{
@patternType type t
scala.quoted.runtime.Patterns.patternHole[Set[t]].toSet[t$given1.Underlying]
}
}.apply(x$2)
... but we should have '{
{
@patternType type t
scala.quoted.runtime.Patterns.patternHole[Set[t]].toSet[t]
}
}.apply(x$2) This must be a bug in |
Simpler workaround- case '{ ($x: Set[t]).toSet } =>
+ case '{ type t; ($x: Set[`t`]).toSet } => |
```scala case '{ type u; f($x: t, $y: t, $z: u) } ``` is desugared to ```scala case '{ type t; type u; f($x: `t`, $y: `t`, $z: `u`) } ``` Fixes scala#14708
```scala case '{ type u; ($x: t, $y: t, $z: u) } ``` is desugared to ```scala case '{ type t; type u; ($x: `t`, $y: `t`, $z: `u`) } ``` Fixes scala#14708
```scala case '{ type u; ($x: t, $y: t, $z: u) } ``` is desugared to ```scala case '{ type t; type u; ($x: `t`, $y: `t`, $z: `u`) } ``` Fixes scala#14708
```scala case '{ type u; ($x: t, $y: t, $z: u) } ``` is desugared to ```scala case '{ type t; type u; ($x: `t`, $y: `t`, $z: `u`) } ``` Fixes scala#14708
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Fixes scala#14708 Fixes scala#16522 Fixes scala#18125 Fixes scala#18250
Compiler version
Minimized code
workaround(?)
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: