erg/tests/should_ok/inherit.er
2024-02-08 02:42:49 +09:00

15 lines
194 B
Python

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