Skip to content

Wrong insertion location in fix-it for missing parentheses around parameter type list #2431

@AnthonyLatsis

Description

@AnthonyLatsis

Description

It seems we’re forgetting about trailing trivia when computing the insertion location for the closing paren.

Steps to Reproduce

let _ : Float -> Int
error: expected '(' to start function type [bridged_error]
let _ : Float -> Int
        ^
note: insert '(' [bridged_note]
let _ : Float -> Int
        ^
        (
error: expected ')' in function type [bridged_error]
let _ : Float -> Int
              ^
note: insert ')' [bridged_note]
let _ : Float -> Int
             ~^
              )

Metadata

Metadata

Assignees

No one assigned

    Labels

    SwiftParserBugs in the (new) Parser written in SwiftbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions