File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
test/dotty/tools/pc/tests/inlayHints Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -526,17 +526,17 @@ object XRayModeHint:
526526 anotherTree
527527 .innerSelect()
528528 */
529- case a @ Apply (inner, _)
530- if inner.sourcePos.exists && ! isParentOnSameLine && ! isParentApply &&
531- endsInSimpleSelect(a ) && isEndOfLine(tree.sourcePos) =>
532- Some ((a .tpe.widen.deepDealiasAndSimplify, tree.sourcePos))
529+ case apply @ Apply (inner, _)
530+ if ! apply.span.isZeroExtent && inner.sourcePos.exists && ! isParentOnSameLine &&
531+ ! isParentApply && endsInSimpleSelect(apply ) && isEndOfLine(tree.sourcePos) =>
532+ Some ((apply .tpe.widen.deepDealiasAndSimplify, tree.sourcePos))
533533 /*
534534 innerTree
535535 .select
536536 */
537537 case select @ Select (innerTree, _)
538- if innerTree.sourcePos.exists && ! isParentOnSameLine && ! isParentApply &&
539- isEndOfLine(tree.sourcePos) =>
538+ if ! select.span.isZeroExtent && innerTree.sourcePos.exists &&
539+ ! isParentOnSameLine && ! isParentApply && isEndOfLine(tree.sourcePos) =>
540540 Some ((select.tpe.widen.deepDealiasAndSimplify, tree.sourcePos))
541541 case _ => None
542542 else None
Original file line number Diff line number Diff line change @@ -1668,4 +1668,23 @@ class InlayHintsSuite extends BaseInlayHintsSuite {
16681668 |""" .stripMargin
16691669 )
16701670
1671+ @ Test def `xray-metals-i7999` =
1672+ check(
1673+ """ |object Main{
1674+ | case class User(
1675+ | name: String = {
1676+ | Map.toString
1677+ | }
1678+ | )
1679+ |}
1680+ |""" .stripMargin,
1681+ """ |object Main{
1682+ | case class User(
1683+ | name: String = {
1684+ | Map.toString
1685+ | }
1686+ | )
1687+ |}
1688+ |""" .stripMargin
1689+ )
16711690}
You can’t perform that action at this time.
0 commit comments