6891079: Compiler allows invalid binary literals 0b and oBL

Reviewed-by: darcy
This commit is contained in:
Jonathan Gibbons 2009-10-13 15:26:30 -07:00
parent 837c2b0a07
commit 51a7e38600
4 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,12 @@
/* @test /nodynamiccopyright/
* @bug 6891079
* @summary Compiler allows invalid binary literals 0b and oBL
* @compile/fail/ref=T6891079.out -XDrawDiagnostics T6891079.java
*/
class Test {
int bi = 0B;
long bl = 0BL;
int xi = 0X;
long xl = 0XL;
}

View file

@ -0,0 +1,7 @@
T6891079.java:8:14: compiler.err.invalid.binary.number
T6891079.java:9:15: compiler.err.invalid.binary.number
T6891079.java:9:18: compiler.err.expected: token.identifier
T6891079.java:10:14: compiler.err.invalid.hex.number
T6891079.java:11:15: compiler.err.invalid.hex.number
T6891079.java:11:18: compiler.err.expected: token.identifier
6 errors