Skip to content

Commit

Permalink
Add test for nim compiler regression 23233
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Jan 23, 2024
1 parent d9394dc commit c9705ee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,15 @@ suite "Parse to runtime dynamic structure":
n["array"][4].kind == JsonValueKind.Array
n["array"][4].len == 1
n["object"]["def"].boolVal == false

test "nim v2 regression #23233":
# Nim compiler bug #23233 will prevent
# compilation if both JsonValueRef[uint64] and JsonValueRef[string]
# are instantiated at together.
var r1 = toReader(jsonText)
let n1 = r1.parseValue(uint64)
discard n1

var r2 = toReader(jsonText)
let n2 = r2.parseValue(string)
discard n2

0 comments on commit c9705ee

Please sign in to comment.