File tree Expand file tree Collapse file tree 5 files changed +13
-9
lines changed
compiler/src/dotty/tools/dotc/staging Expand file tree Collapse file tree 5 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ class CrossStageSafety extends TreeMapWithStages {
92
92
case tree : TypeDef if tree.symbol.is(Case ) && level > 0 =>
93
93
report.error(reporting.CaseClassInInlinedCode (tree), tree)
94
94
super .transform(tree)
95
+ case tree @ SplicedType (splicedTree) =>
96
+ transformSpliceType(splicedTree, tree)
95
97
case _ =>
96
98
super .transform(tree)
97
99
}
@@ -151,7 +153,7 @@ class CrossStageSafety extends TreeMapWithStages {
151
153
untpd.cpy.Splice (splice)(body1).withType(tpe1)
152
154
}
153
155
154
- protected def transformSpliceType (body : Tree , splice : Select )(using Context ): Tree = {
156
+ private def transformSpliceType (body : Tree , splice : Select )(using Context ): Tree = {
155
157
val body1 = transform(body)(using spliceContext)
156
158
if ctx.reporter.hasErrors then
157
159
splice
Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
33
33
/** Transform the expression splice `splice` which contains the spliced `body`. */
34
34
protected def transformSplice (body : Tree , splice : Splice )(using Context ): Tree
35
35
36
- /** Transform the type splice `splice` which contains the spliced `body`. */
37
- protected def transformSpliceType (body : Tree , splice : Select )(using Context ): Tree
38
-
39
36
override def transform (tree : Tree )(using Context ): Tree =
40
37
if (tree.source != ctx.source && tree.source.exists)
41
38
transform(tree)(using ctx.withSource(tree.source))
@@ -67,9 +64,6 @@ abstract class TreeMapWithStages extends TreeMapWithImplicits {
67
64
transformSplice(splicedTree, tree)
68
65
}
69
66
70
- case tree @ SplicedType (splicedTree) =>
71
- transformSpliceType(splicedTree, tree)
72
-
73
67
case Block (stats, _) =>
74
68
val defSyms = stats.collect { case defTree : DefTree => defTree.symbol }
75
69
super .transform(tree)(using symbolsInCurrentLevel(defSyms))
Original file line number Diff line number Diff line change 1
1
import scala .quoted .*
2
2
3
3
object T {
4
- def impl [A ](using t : Type [A ])(using Quotes ): Expr [Unit ] = {
4
+ def impl [A ](t : Type [A ])(using Quotes ): Expr [Unit ] = {
5
5
Expr .summon[t.Underlying ] // error
6
6
' {}
7
7
}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ case class T(x: Type[_ <: Any])
4
4
5
5
object T {
6
6
def impl [A ](t : T )(using ctx : Quotes ): Expr [Unit ] = {
7
- Expr .summon[t.x.Underlying ] // error // error
7
+ Expr .summon[t.x.Underlying ] // error
8
8
' {}
9
9
}
10
10
}
Original file line number Diff line number Diff line change
1
+ import scala .quoted .*
2
+
3
+ object T {
4
+ def impl [A ](using t : Type [A ])(using Quotes ): Expr [Unit ] = {
5
+ Expr .summon[t.Underlying ]
6
+ ' {}
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments