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

[Nashorn] Wrong static type return value on some assignment operators

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u40
    • 8u40
    • core-libs
    • 9
    • generic
    • generic

      Running b-=a, b*=a, b/=a or b%=a on global variables like: var a=1, b=2 the return type is wrong, we get double instead of int.
      I tried with b = b - a and it worked, I got an int.

      Repro:
      =====
      var inspect = Java.type("jdk.nashorn.test.tools.StaticTypeInspector").inspect
      var a=1,b=2;
      print(inspect(b-=a, " assignment substraction "))

            lagergren Marcus Lagergren
            mnunez Matherey Nunez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: