Skip to content

Tabs in Java lead to incorrect error position #6809

Closed

Description

@Arthurm1

With code...

    int i = 12345.6;   // <<- line has 2 tabs before `int`
    int j = 12345.6;   // <<- line has 4 spaces before `int`

Leads to console output of...

5724] [error] Filename.java:XX:25
5724]           int i = 12345.6;
5724]                         ^     // <<- should highlight the entire `12345.6` as below
5724] incompatible types: possible lossy conversion from double to int
5724]
5724] [error] Filename.java:XX:13
5724]     int j = 12345.6;
5724]             ^^^^^^^
5724] incompatible types: possible lossy conversion from double to int

So the use of tabs causes the highlighting of the error position to be wrong.

Not sure if this is Mill or Zinc. I think the Java Diagnostic class treats a tab as 8 spaces when it comes to column position.

Here's an example of scip-java handling it

Activity

  1. added this to the 1.1.3 milestone on Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions