File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -852,12 +852,13 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
852
852
}
853
853
854
854
/** The qualifier part of a Select or Ident.
855
- * For an Ident, this is the `This` of the current class.
855
+ * For an Ident, this is the `This` of the current class, with the span of
856
+ * the original tree.
856
857
*/
857
858
def qualifier (tree : Tree )(using Context ): Tree = tree match {
858
859
case Select (qual, _) => qual
859
860
case tree : Ident => desugarIdentPrefix(tree)
860
- case _ => This (ctx.owner.enclosingClass.asClass)
861
+ case _ => This (ctx.owner.enclosingClass.asClass).withSpan(tree.span)
861
862
}
862
863
863
864
/** Is this a (potentially applied) selection of a member of a structural type
Original file line number Diff line number Diff line change @@ -1403,13 +1403,14 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
1403
1403
/** Recover identifier prefix (e.g. this) if it exists */
1404
1404
def desugarIdentPrefix (tree : Ident )(using Context ): Tree = tree.tpe match {
1405
1405
case TermRef (prefix : TermRef , _) =>
1406
- prefix.info match
1407
- case mt : MethodType if mt.paramInfos.isEmpty && mt.resultType.typeSymbol.is(Module ) =>
1408
- ref(mt.resultType.typeSymbol.sourceModule)
1409
- case _ =>
1410
- ref(prefix)
1406
+ { prefix.info match
1407
+ case mt : MethodType if mt.paramInfos.isEmpty && mt.resultType.typeSymbol.is(Module ) =>
1408
+ ref(mt.resultType.typeSymbol.sourceModule)
1409
+ case _ =>
1410
+ ref(prefix)
1411
+ }.withSpan(tree.span)
1411
1412
case TermRef (prefix : ThisType , _) =>
1412
- This (prefix.cls)
1413
+ This (prefix.cls).withSpan(tree.span)
1413
1414
case _ =>
1414
1415
EmptyTree
1415
1416
}
You can’t perform that action at this time.
0 commit comments