Commit c4b475f
fix: KotlinVisitor.visitAnnotatedExpression now traverses inner expression (#6870)
* fix: KotlinVisitor.visitAnnotatedExpression now traverses inner expression
The visitAnnotatedExpression method visited the annotation list but
silently skipped visitAndCast on ae.getExpression(). This caused any
visitor override (e.g. visitMethodInvocation) to miss nodes inside
an annotated expression like @Suppress try { ... }.
Fixes #6868
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: restore accidentally removed annotatedTypeInFunctionTypeParens test
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix the AnnotatedExpression inner expression traversal
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Tim te Beek <tim@moderne.io>
Co-authored-by: Jente Sondervorst <jentesondervorst@gmail.com>1 parent fda3bb6 commit c4b475f
4 files changed
Lines changed: 45 additions & 1 deletion
File tree
- rewrite-kotlin/src
- main/java/org/openrewrite/kotlin
- format
- test/java/org/openrewrite/kotlin/tree
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
782 | 785 | | |
783 | 786 | | |
784 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
785 | 824 | | |
0 commit comments