File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -1104,6 +1104,8 @@ class Inliner(val call: tpd.Tree)(using Context):
11041104 new TreeAccumulator [List [Symbol ]] {
11051105 override def apply (syms : List [Symbol ], tree : tpd.Tree )(using Context ): List [Symbol ] =
11061106 tree match {
1107+ case Closure (env, meth, tpt) if meth.symbol.isAnonymousFunction =>
1108+ this (syms, tpt :: env)
11071109 case tree : RefTree if tree.isTerm && level == - 1 && tree.symbol.isDefinedInCurrentRun && ! tree.symbol.isLocal =>
11081110 foldOver(tree.symbol :: syms, tree)
11091111 case _ : This if level == - 1 && tree.symbol.isDefinedInCurrentRun =>
Original file line number Diff line number Diff line change 1+ //> using options -experimental -Yno-experimental
2+
3+ import scala .annotation .{experimental , MacroAnnotation }
4+ import scala .quoted .*
5+
6+ class ImplicitValue
7+
8+ object ImplicitValue :
9+ inline given ImplicitValue =
10+ $ { makeImplicitValue }
11+
12+ def makeImplicitValue (using Quotes ) =
13+ import quotes .reflect .*
14+ ' { ImplicitValue () }
15+ end ImplicitValue
16+
17+ @ experimental
18+ class Test extends MacroAnnotation :
19+ def transform (using Quotes )(tree : quotes.reflect.Definition ) =
20+ import quotes .reflect .*
21+ Implicits .search(TypeRepr .of[ImplicitValue ])
22+ List (tree)
Original file line number Diff line number Diff line change 1+ //> using options -experimental -Yno-experimental
2+
3+ class OuterClass :
4+ @ Test
5+ class InnerClass
6+
7+ @ Test
8+ object InnerObject
9+ end OuterClass
10+
11+ object OuterObject :
12+ @ Test
13+ class InnerClass
14+
15+ @ Test
16+ object InnerObject
17+ end OuterObject
You can’t perform that action at this time.
0 commit comments