class Thing pass class X # overload method by generic vs. non-generic: def foo as Object return 1 def foo as T where T must be Thing return Thing() to T class P def main assert .a == 1 assert (.b to dynamic) inherits Thing def a as Object? return X().foo def b as Thing return X().foo # <-- this is the big test # the method resolution must favor the generic method # we can tell if it chose the non-generic method because its # return type is not compatible with this method's return type