From c9705eee648ceec54d625f1c2b4c4951e3c0fabc Mon Sep 17 00:00:00 2001 From: jangko Date: Tue, 23 Jan 2024 09:15:31 +0700 Subject: [PATCH] Add test for nim compiler regression 23233 --- tests/test_parser.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_parser.nim b/tests/test_parser.nim index 78fdfc7..144b2b2 100644 --- a/tests/test_parser.nim +++ b/tests/test_parser.nim @@ -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