# Test 'name from var' uses '__name' if no '_name' class Point # TODO: cover `pro` and `set` # TODO: verify _x is protected and __y is private var _x as int # protected var __y as int # private var _xy = 200 var __xy = 220 cue init base.init _x = 100 __y = 101 get x from var # typical property with explicit _named var backing get y from var # no _y var but there is __y pro xy from var # map onto _xy def moveBy(dx as int, dy as int) _x += dx __y += dy def main is shared p = Point() assert p.x == 100 assert p.y == 101 assert p.xy == 200 assert p._xy == p.xy p.xy += 2 assert p.xy == 202 assert p._xy == p.xy assert p.__xy == 220 assert p.xy <> p.__xy p.moveBy(2,2) assert p.x == 102 assert p.y == 103 assert p._x == p.x assert p.__y == p.y