Code model of JavaOp.ForOp does not handle (un)boxing correctly

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: repo-babylon
    • Component/s: core-libs

      The code model of `for (int i : List.of(1, 2, 3, 4))` does not handle types, boxing and unboxing correctly.

      Lowered code model contains following invalid fragment:
        ^block_1(%11 : java.type:"java.util.List<java.lang.Integer>"):
          %12 : java.type:"java.util.Iterator<int>" = invoke %11 @java.ref:"java.lang.Iterable::iterator():java.util.Iterator";
          branch ^block_2;

      Related test `TestEnhancedForOp` verifies the code model by interpretation, which is insufficient, as it does not distinguish between boxed and unboxed types.

        1. javac_fix.patch
          2 kB
          Maurizio Cimadamore

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: