Files
Nim/tests/vm/tquadplus.nim
ringabout 3dbf2ac946 remove echo statements in tests (part 1) (#20178)
* remove echo statements

* Update tests/vm/triangle_array.nim

* Update tests/vm/tyaytypedesc.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 19:28:51 +02:00

15 lines
283 B
Nim

# bug #1023
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
doAssert $C.d & " == " & $(A+B).d == "1 == 1"