class A pass class B inherits A pass class Test def main is shared t = Test() t.foo(5) # .error. Argument 1 of method "foo" expects type String, but the call is supplying type int. b as B? b = B() t.bar(b) # .error. Argument 1 of method "bar" expects a non-nilable type (A), but the call is supplying a nilable type (B?). def foo(s as String) pass def bar(a as A) pass