Skip to content

Commit 69cff24

Browse files
committed
Use parameter span for type match _
1 parent 5eae7f4 commit 69cff24

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,13 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
444444
case _ => tree
445445
}
446446
case tree: Ident =>
447+
/* The span of the argument or the span of the tree is the tree is a type match `_` */
448+
def span = paramSpan.getOrElse(tree.name, tree.span)
447449
paramProxy.get(tree.tpe) match {
448450
case Some(t) if tree.isTerm && t.isSingleton =>
449-
singleton(t.dealias).withSpan(paramSpan(tree.name))
451+
singleton(t.dealias).withSpan(span)
450452
case Some(t) if tree.isType =>
451-
TypeTree(t).withSpan(paramSpan(tree.name))
453+
TypeTree(t).withSpan(span)
452454
case _ => tree
453455
}
454456
case tree => tree

0 commit comments

Comments
 (0)