From d913fdb2800d83680e413cd8a5f07b7f85deac6e Mon Sep 17 00:00:00 2001 From: "rumpf_a@web.de" <> Date: Sun, 21 Feb 2010 19:42:36 +0100 Subject: start of tests refactoring; sqlite3 new wrapper fixes --- tests/accept/compile/tobject2.nim | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/accept/compile/tobject2.nim (limited to 'tests/accept/compile/tobject2.nim') diff --git a/tests/accept/compile/tobject2.nim b/tests/accept/compile/tobject2.nim new file mode 100644 index 000000000..8f69a6bac --- /dev/null +++ b/tests/accept/compile/tobject2.nim @@ -0,0 +1,21 @@ +# Tests the object implementation + +type + TPoint2d = object + x, y: int + + TPoint3d = object of TPoint2d + z: int # added a field + +proc getPoint( p: var TPoint2d) = + {.breakpoint.} + writeln(stdout, p.x) + +var + p: TPoint3d + +TPoint2d(p).x = 34 +p.y = 98 +p.z = 343 + +getPoint(p) -- cgit 1.4.1-2-gfad0