-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Assertion failure for macros during separate compilation #7343
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
Labels
Comments
Could be another manifestation of this issue: Macros_1.scala import scala.quoted.{ QuoteContext, Expr }
trait Foo
inline def g(em: Expr[Foo])(given x$2: QuoteContext) = scala.internal.Quoted.exprQuote[Foo](
scala.internal.Quoted.exprSplice[Foo](
{
(given evidence$1: scala.quoted.QuoteContext) => em
}
)
).apply(given x$2) Macros_2.scala import scala.quoted.{ QuoteContext, Expr }
def h(m: Expr[Foo])(given QuoteContext): Expr[Any] = g(m) Separate compilation with Assertion failurechecking /Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala after phase reifyQuotes
exception while typing scala.internal.Quoted.exprQuote[Foo] of class class dotty.tools.dotc.ast.Trees$TypeApply # 2142
exception while typing '{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
} of class class dotty.tools.dotc.ast.Trees$Apply # 2145
exception while typing '{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply of class class dotty.tools.dotc.ast.Trees$Select # 2146
exception while typing '{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply(
{
x$2
}
) of class class dotty.tools.dotc.ast.Trees$Apply # 2147
exception while typing {
'{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply(
{
x$2
}
)
} of class class dotty.tools.dotc.ast.Trees$Inlined # 1348
exception while typing def h(m: quoted.Expr[Foo])(given x$2: quoted.QuoteContext): quoted.Expr[Any] =
{
'{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply(
{
x$2
}
)
} of class class dotty.tools.dotc.ast.Trees$DefDef # 1349
exception while typing @scala.annotation.internal.SourceFile(
"/Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala"
) final module class Macros_2$package$() extends Object(), _root_.scala.
Serializable
{ this: Macros_2$package.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[Macros_2$package.type])
def h(m: quoted.Expr[Foo])(given x$2: quoted.QuoteContext): quoted.Expr[Any]
=
{
'{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply(
{
x$2
}
)
}
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1359
exception while typing package <empty> {
import scala.quoted.{QuoteContext, Expr}
final lazy module val Macros_2$package: Macros_2$package$ =
new Macros_2$package$()
@scala.annotation.internal.SourceFile(
"/Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala"
) final module class Macros_2$package$() extends Object(), _root_.scala.
Serializable
{ this: Macros_2$package.type =>
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[Macros_2$package.type])
def h(m: quoted.Expr[Foo])(given x$2: quoted.QuoteContext): quoted.Expr[Any]
=
{
'{
${
{
{
def $anonfun(given evidence$1: scala.quoted.QuoteContext):
quoted.Expr[Foo]
=
{
{
m
}
}
closure($anonfun)
}
}
}
}.apply(
{
x$2
}
)
}
}
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 1360
*** error while checking /Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala after phase reifyQuotes ***
exception occurred while compiling /Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala
java.lang.AssertionError: assertion failed while compiling /Users/anatolii/Projects/dotty/pg/i1/Macros_2.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
at dotty.tools.dotc.transform.ReifyQuotes.checkPostCondition(ReifyQuotes.scala:80)
at dotty.tools.dotc.transform.TreeChecker.dotty$tools$dotc$transform$TreeChecker$Checker$$_$typedUnadapted$$anonfun$1(TreeChecker.scala:318)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:305)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:318)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2239)
at dotty.tools.dotc.typer.ReTyper.typedFunPart(ReTyper.scala:72)
at dotty.tools.dotc.typer.Applications.typedTypeApply(Applications.scala:1001)
at dotty.tools.dotc.typer.Typer.typedTypeApply(Typer.scala:83)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2077)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2115)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2239)
at dotty.tools.dotc.typer.ReTyper.typedFunPart(ReTyper.scala:72)
at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:839)
at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:966)
at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:83)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2059)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2115)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.ReTyper.typedSelect(ReTyper.scala:41)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedSelect(TreeChecker.scala:374)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2039)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2114)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2239)
at dotty.tools.dotc.typer.ReTyper.typedFunPart(ReTyper.scala:72)
at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:839)
at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:966)
at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:83)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2059)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2115)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2149)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1289)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedInlined$$anonfun$1(TreeChecker.scala:460)
at dotty.tools.dotc.transform.TreeChecker$Checker.withDefinedSyms(TreeChecker.scala:168)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedInlined(TreeChecker.scala:460)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2080)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2115)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2239)
at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1598)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedDefDef$$anonfun$2$$anonfun$1(TreeChecker.scala:431)
at dotty.tools.dotc.transform.TreeChecker$Checker.withDefinedSyms(TreeChecker.scala:168)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedDefDef$$anonfun$1(TreeChecker.scala:434)
at dotty.tools.dotc.transform.TreeChecker$Checker.withDefinedSyms(TreeChecker.scala:168)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedDefDef(TreeChecker.scala:435)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2046)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2114)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2182)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2226)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:475)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1725)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedClassDef(TreeChecker.scala:415)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2049)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2114)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2182)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2226)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:475)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1850)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2090)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2115)
at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:301)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2163)
at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2239)
at dotty.tools.dotc.transform.TreeChecker.check(TreeChecker.scala:121)
at dotty.tools.dotc.transform.TreeChecker.run(TreeChecker.scala:94)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
at scala.collection.immutable.List.map(List.scala:219)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:159)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.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:169)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:177)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
at dotty.tools.dotc.Run.compileUnits(Run.scala:184)
at dotty.tools.dotc.Run.compileSources(Run.scala:121)
at dotty.tools.dotc.Run.compile(Run.scala:104)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
at dotty.tools.dotc.Driver.process(Driver.scala:178)
at dotty.tools.dotc.Driver.process(Driver.scala:147)
at dotty.tools.dotc.Driver.process(Driver.scala:159)
at dotty.tools.dotc.Driver.main(Driver.scala:186)
at dotty.tools.dotc.Main.main(Main.scala) |
Minimizes to: Macro_1.scala inline def g(given scala.quoted.QuoteContext) = '{1} Macro_2.scala def h(given scala.quoted.QuoteContext) = g |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 31, 2020
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 31, 2020
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 1, 2020
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 3, 2020
nicolasstucki
added a commit
that referenced
this issue
Apr 6, 2020
Fix #7343: Detect inlined quotes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Macros_1.scala:
Macros_2.scala:
Compile separately and the second one with
-Ycheck:all
, e.g.:You will see:
Assertion failure
Can be related to #7342.
The text was updated successfully, but these errors were encountered: