decaf-lang / decaf-lang/decaf

Bad error position in BadNewArrayLength and SubNotIntError

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
67
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Input:
```java
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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.