When formatting a function, method, getter, or function type, the formatter hoists any leading comments out so that they don't force a split between the return type and body.
However, it failed to take into account modifiers that may occur before the return type but after the comment. If that happened, the comment would get moved before the modifiers.
When formatting a function, method, getter, or function type, the formatter hoists any leading comments out so that they don't force a split between the return type and body.
However, it failed to take into account modifiers that may occur before the return type but after the comment. If that happened, the comment would get moved before the modifiers.
Fix #1585.