class A def foo(a as A) pass class B inherits A def foo(a as A) base.foo(a) def bar x = A() to dynamic .foo(x) # the above call combined with `x` being `dynamic` and the override of `foo` # used to reveal a code generation bug class Program def main b = B() b.bar