Skip to content

Bad error position in BadNewArrayLength and SubNotIntError  #12

@equation314

Description

@equation314

Input:

class Main {
    static void main() {
        int[][] test;
        int[] a = new int[test[10]];
        int[] b = new int[main()];
        main()[10] = 1;
    }
}

Output:

*** Error at (4,31): new array length must be an integer
*** Error at (5,31): new array length must be an integer
*** Error at (6,13): [] can only be applied to arrays

Should be:

*** Error at (4,27): new array length must be an integer
*** Error at (5,27): new array length must be an integer
*** Error at (6,15): [] can only be applied to arrays

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