langtools/test/tools/javac/8138840/T8139243.java
author mcimadamore
Mon, 12 Oct 2015 12:24:33 +0100
changeset 33018 9790ed482dd0
permissions -rw-r--r--
8138840: NPE when compiling bitwise operations with illegal operand types 8139243: compiler crashes with exception on sum operation of String var and void method call result 8139249: Compiler crashes on unary bitwise complement with non-integral operand Summary: Certain binary operator checks are accepting more operands than required. Reviewed-by: jlahoda

/*
 * @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() { }
}