Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8139249

Compiler crashes on unary bitwise complement with non-integral operand

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9.1
    • 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.

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

                Created:
                Updated:
                Resolved: