unittest = pyimport "unittest"

Test! = Inherit unittest.TestCase!
_ = Test!

# forward reference
C = Class { .x = D }
D = Class { .y = Int }
D.
    new y = Self::__new__ { .y; }
    @staticmethod
    foo x = x + 1
    one = Self.new 1

d = D.new 1
assert d.foo(1) == 2

c = C.new { .x = D.new(1) }
assert c.x.y == 1

Vec = Class [Int; _]
Vec.
    sum self =
        sum(self::base)

v = Vec.new [1, 2, 3]
assert v.sum() == 6
