File tree 2 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -819,13 +819,15 @@ object Trees {
819
819
820
820
class EmptyTree [T >: Untyped ] extends Thicket (Nil )(NoSource ) {
821
821
// assert(uniqueId != 1492)
822
+ override def withSpan (span : Span ) = throw new AssertionError (" Cannot change span of EmptyTree" )
822
823
}
823
824
824
825
class EmptyValDef [T >: Untyped ] extends ValDef [T ](
825
826
nme.WILDCARD , genericEmptyTree[T ], genericEmptyTree[T ])(NoSource ) with WithoutTypeOrPos [T ] {
826
827
myTpe = NoType .asInstanceOf [T ]
827
- override def isEmpty : Boolean = true
828
828
setMods(untpd.Modifiers (PrivateLocal ))
829
+ override def isEmpty : Boolean = true
830
+ override def withSpan (span : Span ) = throw new AssertionError (" Cannot change span of EmptyValDef" )
829
831
}
830
832
831
833
@ sharable val theEmptyTree : EmptyTree [Type ] = new EmptyTree [Type ]
Original file line number Diff line number Diff line change @@ -448,8 +448,8 @@ class Staging extends MacroTransformWithImplicits {
448
448
else if (enclosingInlineds.nonEmpty) { // level 0 in an inlined call
449
449
val spliceCtx = ctx.outer // drop the last `inlineContext`
450
450
val pos : SourcePosition = spliceCtx.source.atSpan(enclosingInlineds.head.span)
451
- val evaluatedSplice = Splicer .splice(splice.qualifier, pos, macroClassLoader)(spliceCtx).withSpan(splice.span)
452
- if (ctx.reporter.hasErrors) splice else transform(evaluatedSplice)
451
+ val evaluatedSplice = Splicer .splice(splice.qualifier, pos, macroClassLoader)(spliceCtx)
452
+ if (ctx.reporter.hasErrors) splice else transform(evaluatedSplice.withSpan(splice.span) )
453
453
}
454
454
else if (! ctx.owner.isInlineMethod) { // level 0 outside an inline method
455
455
ctx.error(i " splice outside quotes or inline method " , splice.sourcePos)
You can’t perform that action at this time.
0 commit comments