# inheritance of generic of nilable type class A inherits Dictionary pass class X # argument of generic of nilable type def foo(expectedCount as int, objects as IEnumerable) results = [] for object in objects if object, results.add(object) assert results.count == expectedCount def main .foo(2, [nil, 5, nil, 'aoeu']) a = A() a[3] = 'aoeu' a[4] = nil assert a.count == 2 assert a[3] == 'aoeu' assert a[4] == nil