decaf icon indicating copy to clipboard operation
decaf copied to clipboard

Bad error position in BadNewArrayLength and SubNotIntError

Open equation314 opened this issue 6 years ago • 0 comments

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

equation314 avatar Nov 04 '19 05:11 equation314