openrewrite / rewrite-kotlin

Work-in-progress implementation of Kotlin language support for OpenRewrite.
Apache License 2.0
38 stars 11 forks source link

Parser issue: fix `lastAnnotations` in various visits #552

Closed traceyyoshima closed 6 months ago

traceyyoshima commented 6 months ago

Various visits create a new ArrayList of lastAnnotations, which is never added to the tree. In at least one of the visits, it will lead to a parsing error where annotations will disappear.

If trailing annotations cannot exist after modifiers in the visits, the new array list should be removed: