Skip to content

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

Closed
anatoliykmetyuk opened this issue Sep 30, 2019 · 2 comments
Closed

Assertion failure for macros during separate compilation #7343

anatoliykmetyuk opened this issue Sep 30, 2019 · 2 comments
Assignees

Comments

@anatoliykmetyuk
Copy link
Contributor

Macros_1.scala:

import scala.quoted.{ QuoteContext, Expr }

trait M {
  def f: Any
}

inline def g(em: Expr[M])(given QuoteContext) = '{$em.f}

Macros_2.scala:

import scala.quoted.{ QuoteContext, Expr }

def h(m: Expr[M])(given QuoteContext): Expr[Any] = g(m)

Compile separately and the second one with -Ycheck:all, e.g.:

sbt:dotty> ;dotty-bootstrapped/dotc ../pg/i1/Macros_1.scala ;dotty-bootstrapped/dotc -Ycheck:all -classpath . ../pg/i1/Macros_2.scala

You will see:

Assertion failure
checking ../pg/i1/Macros_2.scala after phase reifyQuotes
exception while typing scala.internal.Quoted.exprQuote[Any] of class class dotty.tools.dotc.ast.Trees$TypeApply # 3160
exception while typing '{
  ${
    {
      def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M] =
        {
          m
        }
      closure($anonfun)
    }
  }.f
} of class class dotty.tools.dotc.ast.Trees$Apply # 3164
exception while typing '{
  ${
    {
      def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M] =
        {
          m
        }
      closure($anonfun)
    }
  }.f
}.apply of class class dotty.tools.dotc.ast.Trees$Select # 3165
exception while typing '{
  ${
    {
      def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M] =
        {
          m
        }
      closure($anonfun)
    }
  }.f
}.apply(
  {
    x$2
  }
) of class class dotty.tools.dotc.ast.Trees$Apply # 3166
exception while typing {
  '{
    ${
      {
        def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M] =
          {
            m
          }
        closure($anonfun)
      }
    }.f
  }.apply(
    {
      x$2
    }
  )
} of class class dotty.tools.dotc.ast.Trees$Inlined # 1351
exception while typing def h(m: quoted.Expr[M])(given x$2: quoted.QuoteContext): quoted.Expr[Any] =
  {
    '{
      ${
        {
          def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M] =
            {
              m
            }
          closure($anonfun)
        }
      }.f
    }.apply(
      {
        x$2
      }
    )
  } of class class dotty.tools.dotc.ast.Trees$DefDef # 1352
exception while typing @scala.annotation.internal.SourceFile("../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[M])(given x$2: quoted.QuoteContext): quoted.Expr[Any] =
    {
      '{
        ${
          {
            def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M]
               =
            {
              m
            }
            closure($anonfun)
          }
        }.f
      }.apply(
        {
          x$2
        }
      )
    }
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 1362
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("../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[M])(given x$2: quoted.QuoteContext): quoted.Expr[Any]
       =
    {
      '{
        ${
          {
            def $anonfun(given evidence$1: quoted.QuoteContext): quoted.Expr[M]
               =
            {
              m
            }
            closure($anonfun)
          }
        }.f
      }.apply(
        {
          x$2
        }
      )
    }
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 1363
*** error while checking ../pg/i1/Macros_2.scala after phase reifyQuotes ***
exception occurred while compiling ../pg/i1/Macros_2.scala
java.lang.AssertionError: assertion failed while compiling ../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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	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:2079)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	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:2061)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	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:2041)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2116)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	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:2061)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2151)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedInlined(Typer.scala:1291)
	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:2082)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1600)
	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:2048)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2116)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2184)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2228)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:475)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1727)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedClassDef(TreeChecker.scala:415)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2051)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2116)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2184)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2228)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedStats(TreeChecker.scala:475)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1852)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2092)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2117)
	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:2153)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2165)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:286)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2241)
	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)

Can be related to #7342.

@anatoliykmetyuk
Copy link
Contributor Author

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 -Ycheck:all:

Assertion failure
checking /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)

@anatoliykmetyuk
Copy link
Contributor Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants