langtools/test/tools/javac/8138840/T8139243.java
author ysuenaga
Wed, 30 Mar 2016 21:05:13 +0900
changeset 37218 c7241bc368bf
parent 33018 9790ed482dd0
permissions -rw-r--r--
8151674: STW phases at Concurrent GC should count in PerfCounter Reviewed-by: jmasa, sla, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33018
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     1
/*
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     3
 * @bug 8138840 8139243 8139249
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     4
 * @summary Compiler crashes when compiling bitwise operations with illegal operand types
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     5
 *          'void' is erroneously accepted as a possible operand for string concatenation
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T8139243.out -XDrawDiagnostics T8139243.java
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     7
 */
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     8
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
     9
class T8139243 {
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    10
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    11
    void test(String s) {
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    12
        s += m(); // compile time error
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    13
    }
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    14
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    15
    void m() { }
9790ed482dd0 8138840: NPE when compiling bitwise operations with illegal operand types
mcimadamore
parents:
diff changeset
    16
}