mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
15 lines
212 B
Python
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
|