Skip to content

Macros crash in Inlines.inlineCallTrace after changes to -> desugering #26796

Description

@WojciechMazur

Based on the OpenCB failure in kalin-rudnicki/oxygen

Compiler version

Last good release: 3.10.0-RC1-bin-20260630-a8ae375-NIGHTLY
First bad release: 3.10.0-RC1-bin-20260701-14f4239-NIGHTLY
Bisect points to 4f67b39

Minimized code

// macro.scala 

import scala.quoted.*

object Macros:
  def impl(using Quotes): Expr[Int] =
    val inner: Expr[Int] = '{ 1 }
    val pair: (Int, Expr[Int]) = 0 -> '{ $inner + 1 }
    pair._2

  inline def trigger: Int = ${ impl }
//> using file macro.scala 

@main def run(): Unit =
  println(Macros.trigger)

Output (click arrow to expand)

Details
Exception in thread "main" java.lang.AssertionError: assertion failed
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:13)
        at dotty.tools.dotc.inlines.Inlines$.inlineCallTrace(Inlines.scala:344)
        at dotty.tools.dotc.transform.PickleQuotes$.pickleAsTasty$1(PickleQuotes.scala:306)
        at dotty.tools.dotc.transform.PickleQuotes$.pickle(PickleQuotes.scala:391)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:98)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1588)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1660)
        at scala.collection.immutable.List.mapConserve(List.scala:470)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1660)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1554)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1562)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1588)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1617)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformBlock(tpd.scala:1320)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1568)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:51)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1620)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1317)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:49)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1622)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1315)
        at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1317)
        at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1633)
        at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:42)
        at dotty.tools.dotc.transform.PickleQuotes$$anon$1.transform(PickleQuotes.scala:102)
        at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:20)
        at dotty.tools.dotc.transform.PickleQuotes.run(PickleQuotes.scala:89)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:405)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:331)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:397)
        at dotty.tools.dotc.Run.runPhases$1(Run.scala:414)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$2(Run.scala:456)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$adapted$1(Run.scala:456)
        at scala.Function0.apply$mcV$sp(Function0.scala:42)
        at dotty.tools.dotc.Run.showProgress(Run.scala:519)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:456)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:469)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:469)
        at dotty.tools.dotc.Run.compileSources(Run.scala:342)
        at dotty.tools.dotc.Run.compile(Run.scala:327)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
        at dotty.tools.dotc.Driver.process(Driver.scala:208)
        at dotty.tools.dotc.Driver.process(Driver.scala:176)
        at dotty.tools.dotc.Driver.process(Driver.scala:188)
        at dotty.tools.dotc.Driver.main(Driver.scala:214)
        at dotty.tools.dotc.Main.main(Main.scala)
Compilation failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugitype:crashregressionThis worked in a previous version but doesn't anymorestat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions