# Testing if-inherits with a class var instead of a parameter/local. class One get foo as int return 1 class SubOne inherits One get sub as int return 3 class Two get bar as int return 2 class Test shared def main Test().run var _obj as Object cue init base.init _obj = Object() def run _obj = One() .check(1) _obj = Two() .check(2) def check(value as int) if _obj inherits One assert _obj.foo==value # using a One member with no casting if _obj inherits SubOne assert _obj.sub==3 # using a SubOne member with no casting else if _obj inherits Two assert _obj.bar==value # using a Two member with no casting else throw Exception('fall through')