[PowerAssert] Find the earliest starting offset for receiver expression

Calls of infix functions have a start offset which doesn't include the
receiver. Property accessors have a start offset at the start of the
property name and do not include their receiver expression. This
combination can cause problems when the entire expression needs to be
displayed, including the entirety of a complex receiver. Make sure to
navigate expressions to find their earliest starting offset and use that
instead.

^KT-65810 Fixed
This commit is contained in:
Brian Norman
2024-02-26 11:59:36 -06:00
committed by Space Team
parent d53d5dddc5
commit 721d02f4f3
10 changed files with 77 additions and 51 deletions
@@ -1,6 +1,6 @@
wrapper mustEqual "world".length
| | |
| | 5
| Wrapper
Holder(wrapper=Wrapper)
Complex.holder.wrapper mustEqual "world".length
| | | |
| | | 5
| | Wrapper
| Holder(wrapper=Wrapper)
Complex
@@ -1,6 +1,6 @@
wrapper.mustEqual("world".length)
| | |
| | 5
| Wrapper
Holder(wrapper=Wrapper)
Complex.holder.wrapper.mustEqual("world".length)
| | | |
| | | 5
| | Wrapper
| Holder(wrapper=Wrapper)
Complex
@@ -1,5 +1,5 @@
length mustEqual "world".length
| |
| 5
3
ell
"hello".substring(1, 4).length mustEqual "world".length
| | |
| | 5
| 3
ell
@@ -1,5 +1,5 @@
length.mustEqual("world".length)
| |
| 5
3
ell
"hello".substring(1, 4).length.mustEqual("world".length)
| | |
| | 5
| 3
ell