File tree 4 files changed +31
-2
lines changed
compiler/src/dotty/tools/dotc/transform
4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,11 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
140
140
141
141
protected def transformSpliceType (body : Tree , splice : Select )(using Context ): Tree = {
142
142
val body1 = transform(body)(using spliceContext)
143
- val tagRef = getQuoteTypeTags.getTagRef(splice.qualifier.tpe.asInstanceOf [TermRef ])
144
- ref(tagRef).withSpan(splice.span)
143
+ if ctx.reporter.hasErrors then
144
+ splice
145
+ else
146
+ val tagRef = getQuoteTypeTags.getTagRef(splice.qualifier.tpe.asInstanceOf [TermRef ])
147
+ ref(tagRef).withSpan(splice.span)
145
148
}
146
149
147
150
/** Check that annotations do not contain quotes and and that splices are valid */
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 ] // error
6
+ ' {}
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+
3
+ case class T (x : Type [_ <: Any ])
4
+
5
+ object T {
6
+ def impl [A ](t : T )(using ctx : Quotes ): Expr [Unit ] = {
7
+ Expr .summon[t.x.Underlying ] // error // error
8
+ ' {}
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+
3
+ object T {
4
+ def impl [A ](using Type [A ])(using Quotes ): Expr [Unit ] = {
5
+ Expr .summon[A ]
6
+ ' {}
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments