jdk-24/test/langtools/tools/javac/8138840/T8139243.java
2017-09-12 19:03:39 +02:00

17 lines
426 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8138840 8139243 8139249
* @summary Compiler crashes when compiling bitwise operations with illegal operand types
* 'void' is erroneously accepted as a possible operand for string concatenation
* @compile/fail/ref=T8139243.out -XDrawDiagnostics T8139243.java
*/
class T8139243 {
void test(String s) {
s += m(); // compile time error
}
void m() { }
}