File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,12 @@ object Trees {
353
353
}
354
354
}
355
355
else span
356
+
357
+ /** The source position of the name defined by this definition.
358
+ * This is a point position if the definition is synthetic, or a range position
359
+ * if the definition comes from source.
360
+ */
361
+ def namePos : SourcePosition = source.atSpan(nameSpan)
356
362
}
357
363
358
364
/** Tree defines a new symbol and carries modifiers.
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ trait QuotesAndSplices {
231
231
cpy.AppliedTypeTree (tree)(transform(tpt), args1)
232
232
case tree : NamedDefTree =>
233
233
if tree.isTerm && ! tree.nameSpan.isSynthetic && tree.symbol.name.startsWith(" $" ) then
234
- ctx.error(" Names cannot start with $ quote pattern" , ctx.source.atSpan( tree.nameSpan) )
234
+ ctx.error(" Names cannot start with $ quote pattern" , tree.namePos )
235
235
super .transform(tree)
236
236
case _ =>
237
237
super .transform(tree)
You can’t perform that action at this time.
0 commit comments