jdk-24/test/langtools/tools/javac/Parens2.java

16 lines
281 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 4408036
* @summary Compiler accepted "(i=2);" as a valid expession statement.
* @author gafter
*
* @compile/fail/ref=Parens2.out -XDrawDiagnostics Parens2.java
2007-12-01 00:00:00 +00:00
*/
class Parens2 {
void f() {
int i;
(i = 2);
}
}