fixes #5339
This commit is contained in:
parent
24a0927644
commit
5ff6ff28bf
2 changed files with 102 additions and 7 deletions
38
tests/ccgbugs/tobjconstr_outoforder.nim
Normal file
38
tests/ccgbugs/tobjconstr_outoforder.nim
Normal file
|
|
@ -0,0 +1,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
|
||||
Loading…
Add table
Add a link
Reference in a new issue