Compiler crashes on unary bitwise complement with non-integral operand

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 9
    • Affects Version/s: 9.1
    • Component/s: tools
    • b88
    • Verified

        Code:

        $ cat ValueOf.java
        public class ValueOf {
            public static void main(String... args) {
                float f1 = ~10;
                float f2 = ~f1;
            }
        }

        Java version:

        $ javac -version
        javac 1.9.0-ea

         Actual compilation result:

        $ javac ValueOf.java
        Fatal Error: Unable to find method valueOf

        Expected result:

        Have compiler.err.operator.cant.be.applied: ~, float, null error.

        It's regression, javac 8u60 produces the error message instead of fatal error.

              Assignee:
              Maurizio Cimadamore
              Reporter:
              Sergei Pikalev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: