erg/tests/should_err/class_attr.er
Shunsuke Shibayama d27dc791bc Reapply "fix: method inference bug"
This reverts commit 099ecbf9d2.
2024-10-03 22:23:18 +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