X10
  1. X10
  2. XTENLANG-1311

if Foo is coercible to Baz, "for (b:Baz in (x as Iterable[Foo])" should be legal

    Details

    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      Given a class Foo with operator this: Baz, the following code does not compile:

      val lf: List[Foo] = new ArrayList[Foo]();
      for (i: Baz in lf) {
          Console.OUT.println(i);
      }
      

      ./IterableTest.x10:24-26: ERROR: Loop domain x10.util.List[IterableTest.Foo]

      {self==lf}

      is not a subtype of Iterable[IterableTest.Baz].
      1 error.

      1. IterableTest.x10
        0.8 kB
        Bowen Alpern
      2. TestIterableSubclass.x10
        0.8 kB
        Josh Milthorpe

        Issue Links

          Activity

          Hide
          David Grove added a comment -

          bulk defer of issues to 2.2.3.

          Show
          David Grove added a comment - bulk defer of issues to 2.2.3.
          Hide
          David Grove added a comment -

          bulk defer of 2.3.0 open issues to 2.3.1.

          Show
          David Grove added a comment - bulk defer of 2.3.0 open issues to 2.3.1.
          Hide
          David Grove added a comment -

          bulk defer to 2.3.2

          Show
          David Grove added a comment - bulk defer to 2.3.2
          Hide
          David Grove added a comment -

          bulk defer to 2.4.1.

          Show
          David Grove added a comment - bulk defer to 2.4.1.
          Hide
          David Grove added a comment -

          By default, targeting all language design issues at next major release (X10 2.5) or later.

          Show
          David Grove added a comment - By default, targeting all language design issues at next major release (X10 2.5) or later.

            People

            • Assignee:
              Unassigned
              Reporter:
              Bowen Alpern
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: