summary refs log tree commit diff stats
path: root/tests/vm/tquadplus.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-03-22 21:18:56 +0100
committerAraq <rumpf_a@web.de>2014-03-22 21:18:56 +0100
commit5f64d7a35389a5f4cac82a44a3f5f9414c2c3fbb (patch)
treee74a16de1e63c83504712df61bfac9a4075d4a1a /tests/vm/tquadplus.nim
parent5f478e5aa125289efa232cd57043b8ee31aad562 (diff)
downloadNim-5f64d7a35389a5f4cac82a44a3f5f9414c2c3fbb.tar.gz
fixes #1023
Diffstat (limited to 'tests/vm/tquadplus.nim')
-rw-r--r--tests/vm/tquadplus.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/vm/tquadplus.nim b/tests/vm/tquadplus.nim
new file mode 100644
index 000000000..552e8fef7
--- /dev/null
+++ b/tests/vm/tquadplus.nim
@@ -0,0 +1,17 @@
+# bug #1023
+
+discard """
+  output: "1 == 1"
+"""
+
+type Quadruple = tuple[a, b, c, d: int]
+
+proc `+`(s, t: Quadruple): Quadruple =
+  (a: s.a + t.a, b: s.b + t.b, c: s.c + t.c, d: s.d + t.d)
+
+const
+  A = (a: 0, b: -1, c: 0, d: 1)
+  B = (a: 0, b: -2, c: 1, d: 0)
+  C = A + B
+
+echo C.d, " == ", (A+B).d