Skip to content

Commit

Permalink
Merge pull request #14528 from dotty-staging/fix-#14373
Browse files Browse the repository at this point in the history
Collect all local class definitions
  • Loading branch information
smarter authored Feb 25, 2022
2 parents d44a189 + 764a905 commit 29e4b05
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ abstract class TreeMapWithStages(@constructorOnly ictx: Context) extends TreeMap
case (_:Import | _:Export) =>
tree

case _: Template =>
val last = enteredSyms
tree.symbol.owner.info.decls.foreach(markSymbol)
mapOverTree(last)

case _ =>
markDef(tree)
mapOverTree(enteredSyms)
Expand Down
10 changes: 10 additions & 0 deletions tests/pos-macros/i14373.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import scala.quoted._
trait Foo
object Foo {
def apply_impl(using Quotes): Expr[Any] = '{
new Foo {
private def foo: String = ???
def bar: Any = ${ '{ foo }; ??? }
}
}
}

0 comments on commit 29e4b05

Please sign in to comment.