summary refs log tree commit diff stats
path: root/tests/ccgbugs/tobjconstr_outoforder.nim
blob: 846a753d5e6fa0732407b6bd915edfaa45034c62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
discard """
  output: '''(left: 1, up: 0, right: 2, down: 0)
(left: 0, up: 1, right: 0, down: 2)
@[(left: 1, up: 0, right: 2, down: 0), (left: 0, up: 1, right: 0, down: 2)]
@[(left: 1, up: 0, right: 2, down: 0), (left: 0, up: 1, right: 0, down: 2)]
true'''
"""

# bug #5339
type
  Dirs = object
    left: int
    up: int
    right: int
    down: int

let
  a = Dirs(
    left: 1,
    right: 2,
  )
  b = Dirs(
    up: 1,
    down: 2,
  )
  works = @[
    a,
    b,
  ]
  fails = @[
    Dirs(left: 1, right: 2),
    Dirs(up: 1, down: 2),
  ]
echo a
echo b
echo works
echo fails
echo works == fails