class Test shared def main obj as Object = List() visited as bool = false if obj inherits List .processListOfInt(obj) visited = true assert not visited if obj inherits List .processListOfString(obj) visited = true assert visited visited = false obj = Dictionary() if obj inherits Dictionary .processDictionary(obj) visited = true assert visited x = X() assert x.isT('hi') assert not x.isT(5) def processListOfInt(list as List) pass def processListOfString(list as List) pass def processDictionary(d as Dictionary) pass class X def isT(item as Object) as bool return item inherits T # use 'inherits' with a generic parameter