Consider code like:
---
int i = 08;
---
This currently produces:
---
/tmp/Octal.java:2: error: ';' expected
int i = 08;
^
1 error
---
This is fairly confusing. The reason is that the literal is an octal literal (hence '8' and '9' does not make sense in the literal). And the lexer will give up lexing after lexing '0', and then lexes '8' as a separate literal, leading to this error.
It would be better if the error pointed out what the problem is more clearly.
Note the current behavior is based onJDK-8267361.
---
int i = 08;
---
This currently produces:
---
/tmp/Octal.java:2: error: ';' expected
int i = 08;
^
1 error
---
This is fairly confusing. The reason is that the literal is an octal literal (hence '8' and '9' does not make sense in the literal). And the lexer will give up lexing after lexing '0', and then lexes '8' as a separate literal, leading to this error.
It would be better if the error pointed out what the problem is more clearly.
Note the current behavior is based on