New Issue: [Bug]: virtual iterators not inherited correctly

28762, "jabraham17", "[Bug]: virtual iterators not inherited correctly", "2026-05-01T18:22:13Z"

Summary of Problem

Description:
I am finding that virtual iterators are not inherited correctly by grandchildren classes

Is this issue currently blocking your progress?
yes. the only workaround is to just not use virtual iterators with deep class hierarchies (more than 2)

Steps to Reproduce

Source Code:


class Parent {
  proc foo() {
    writeln("parent foo");
  }
  iter bar() {
    writeln("bar");
    yield 1;
  }
}

class Child: Parent {
  override proc foo() {
    writeln("child foo");
  }
  override iter bar() {
    writeln("child bar");
    yield 2;
  }
}
class GrandChild: Child { }


proc main() {
  var g: Parent = new GrandChild();
  g.foo();
  var x = g.bar();
}

I would expect this program to print child foo and child bar, but it actually prints child foo and bar.