""" The main point of this test is a generic class with a class var whose type inherits from the class containing the var. This is legal and it even happens once in awhile in real life coding. """ interface IAMember get name as String class A where T must be IAMember var _b as B? # B inherits from A cue init base.init pro b from var def computeA as String return 'A' interface IBMember inherits IAMember get age as int class B inherits A def computeB as String return 'B' class AMember implements IAMember get name as String return 'A' class BMember implements IBMember get name as String return 'B' get age as int return 10 class Test def main is shared a = A() assert a.computeA == 'A' b = B() assert b.computeA == 'A' assert b.computeB == 'B' a.b = b assert a.b is b assert a.b == b c = B() b.b = c assert b.b is c assert a.b.b is c