Skip to content

Type not handled correctly in multistage quote #11587

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

Closed
nicolasstucki opened this issue Mar 3, 2021 · 0 comments · Fixed by #11590
Closed

Type not handled correctly in multistage quote #11587

nicolasstucki opened this issue Mar 3, 2021 · 0 comments · Fixed by #11590
Assignees
Milestone

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.0.0-RC1

Minimized code

import scala.quoted._
class Foo:
  def foo[T: Type](using Quotes): Unit = '{
    def toExpr(using Quotes): Expr[T] = '{ ??? : T }
  }

Output (click arrow to expand)

Exception in thread "main" java.lang.AssertionError: assertion failed: unresolved symbols: type T (line 2) #5195 when pickling tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala while compiling tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala
java.lang.AssertionError: assertion failed: unresolved symbols: type T (line 2) #5195 when pickling tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:782)
        at dotty.tools.dotc.quoted.PickledQuotes$.pickle(PickledQuotes.scala:168)
        at dotty.tools.dotc.quoted.PickledQuotes$.pickleQuote(PickledQuotes.scala:37)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.pickleAsTasty$1(PickleQuotes.scala:222)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.pickledQuote(PickleQuotes.scala:305)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transformQuotation(PickleQuotes.scala:142)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:114)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1315)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1321)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:120)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1422)
        at scala.collection.immutable.List.mapConserve(List.scala:472)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1422)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1420)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1335)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:92)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:136)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:99)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:53)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:60)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:111)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1398)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:104)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1422)
        at scala.collection.immutable.List.mapConserve(List.scala:472)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1422)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1420)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1407)
        at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:104)
        at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:85)
        at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:148)
        at dotty.tools.dotc.transform.PickleQuotes$QuoteReifier.transform(PickleQuotes.scala:514)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:95)
        at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
        at dotty.tools.dotc.transform.PickleQuotes.run(PickleQuotes.scala:91)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:303)
        at scala.collection.immutable.List.map(List.scala:246)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:304)
        at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
        at dotty.tools.dotc.Run.runPhases$5(Run.scala:215)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:223)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:230)
        at dotty.tools.dotc.Run.compileSources(Run.scala:166)
        at dotty.tools.dotc.Run.compile(Run.scala:150)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
        at dotty.tools.dotc.Driver.process(Driver.scala:198)
        at dotty.tools.dotc.Driver.process(Driver.scala:166)
        at dotty.tools.dotc.Driver.process(Driver.scala:178)
        at dotty.tools.dotc.Driver.main(Driver.scala:208)
        at dotty.tools.dotc.Main.main(Main.scala)```
</details>
@nicolasstucki nicolasstucki self-assigned this Mar 3, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 3, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 4, 2021
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 4, 2021
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants