erg/tests/should_ok/inherit.er
2023-03-07 21:48:52 +09:00

15 lines
212 B
Python

@Inheritable
C = Class { .x = Int }
C.
const = 0
C.
new x: Int = C::__new__ { .x = x }
D = Inherit C
D.
@Override
new x: Int = D::__new__ { .x = x }
d: D = D.new(1)
print! d
assert D.const == 0