From 85b8856fd44014e0a708c30345583b55c9096c52 Mon Sep 17 00:00:00 2001 From: Vadim Chelyshov Date: Mon, 12 Sep 2022 22:37:50 +0300 Subject: [PATCH] fix InlineMatch pos for `summonFrom` Use the span of all tree instead of only cases. This is needed for Metals: https://github.com/scalameta/metals/issues/4366 --- compiler/src/dotty/tools/dotc/typer/Applications.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index e11afe261458..d7ca05dfbcce 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -994,7 +994,7 @@ trait Applications extends Compatibility { case CaseDef(pat, _, _) => report.error(UnexpectedPatternForSummonFrom(pat), pat.srcPos) } - typed(untpd.InlineMatch(EmptyTree, cases).withSpan(arg.span), pt) + typed(untpd.InlineMatch(EmptyTree, cases).withSpan(tree.span), pt) case _ => errorTree(tree, em"argument to summonFrom must be a pattern matching closure") }