erg/tests/should_err/class_attr.er
2024-10-02 12:20:48 +09:00

14 lines
173 B
Python

C = Class { .x = Int; .y = Int }
C.
x = "aa"
_: Str = C.x
_ = C.y # ERR
c = C.new({.x = 1; .y = 2})
_: Int = c.x
_: Int = c.y
D = Class()
D.
x = y # ERR
y = 1