File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class TreeMapWithImplicits extends tpd.TreeMap {
6262 private def nestedScopeCtx (defs : List [Tree ])(implicit ctx : Context ): Context = {
6363 val nestedCtx = ctx.fresh.setNewScope
6464 defs foreach {
65- case d : DefTree => nestedCtx.enter(d.symbol)
65+ case d : DefTree if d.symbol.isOneOf( GivenOrImplicit ) => nestedCtx.enter(d.symbol)
6666 case _ =>
6767 }
6868 nestedCtx
@@ -73,7 +73,7 @@ class TreeMapWithImplicits extends tpd.TreeMap {
7373 new TreeTraverser {
7474 def traverse (tree : Tree )(implicit ctx : Context ): Unit = {
7575 tree match {
76- case d : DefTree => nestedCtx.enter(d.symbol)
76+ case d : DefTree if d.symbol.isOneOf( GivenOrImplicit ) => nestedCtx.enter(d.symbol)
7777 case _ =>
7878 }
7979 traverseChildren(tree)
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
3838 transform(tree)(ctx.withSource(tree.source))
3939 else tree match {
4040 case tree : DefDef if tree.symbol.is(Inline ) && level > 0 => EmptyTree
41+ case tree : DefTree =>
42+ for (annot <- tree.symbol.annotations)
43+ transform(annot.tree) given ctx .withOwner(tree.symbol)
44+ checkLevel(super .transform(tree))
4145 case _ => checkLevel(super .transform(tree))
4246 }
4347 }
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+ class Test {
3+ def foo (str : String ) given QuoteContext = ' {
4+ @ deprecated(str, " " ) // error
5+ def bar = ???
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments