Fixes #10005
This commit is contained in:
parent
b53327c92a
commit
19f5835d5c
2 changed files with 33 additions and 33 deletions
|
|
@ -54,3 +54,20 @@ let test2 = test1
|
|||
|
||||
echo toJSON(test1)
|
||||
echo toJSON(test2)
|
||||
|
||||
block issue10005:
|
||||
type
|
||||
Player = ref object of RootObj
|
||||
id*: string
|
||||
nickname*: string
|
||||
color*: string
|
||||
|
||||
proc newPlayer(nickname: string, color: string): Player =
|
||||
let pl = Player(color: "#123", nickname: nickname)
|
||||
return Player(
|
||||
id: "foo",
|
||||
nickname: nickname,
|
||||
color: color,
|
||||
)
|
||||
|
||||
doAssert newPlayer("foo", "#1232").nickname == "foo"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue