File tree 3 files changed +41
-0
lines changed
compiler/src/dotty/tools/dotc/inlines
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):
1104
1104
new TreeAccumulator [List [Symbol ]] {
1105
1105
override def apply (syms : List [Symbol ], tree : tpd.Tree )(using Context ): List [Symbol ] =
1106
1106
tree match {
1107
+ case Closure (env, meth, tpt) if meth.symbol.isAnonymousFunction =>
1108
+ this (syms, tpt :: env)
1107
1109
case tree : RefTree if tree.isTerm && level == - 1 && tree.symbol.isDefinedInCurrentRun && ! tree.symbol.isLocal =>
1108
1110
foldOver(tree.symbol :: syms, tree)
1109
1111
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