Skip to content

Commit

Permalink
fix InlineMatch pos for summonFrom
Browse files Browse the repository at this point in the history
Use the span of all tree instead of only cases.
This is needed for Metals: scalameta/metals#4366
  • Loading branch information
dos65 authored and mpollmeier committed Oct 16, 2022
1 parent bd471c3 commit 1e8a4c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 1e8a4c8

Please sign in to comment.