fixes #1023
This commit is contained in:
parent
5f478e5aa1
commit
5f64d7a353
3 changed files with 50 additions and 21 deletions
17
tests/vm/tquadplus.nim
Normal file
17
tests/vm/tquadplus.nim
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue