Skip to content

DiagnosticsFormatter crashes when source code contains an emoji #2507

@Matejkob

Description

@Matejkob

Description

DiagnosticsFormatter crashes with a Fatal error: Range requires lowerBound <= upperBound message when the source code contains an emoji.

Screenshot 2024-02-21 at 10 51 44 PM

Steps to Reproduce

Run:

swift run swift-parser-cli print-diags -s 'func o() {
  _ = {
    0
    /x}}1️⃣} /
    2
  }
}'

This version:

swift run swift-parser-cli print-diags -s 'func o() {
  _ = {
    0
    /x}}$} /
    2
  }
}'

works.

Tested on main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions