From 47e4f9698cca68a96fbffa6acc0c6d39a6f6420b Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 2 Feb 2014 10:00:10 +0100 Subject: fixes #844 --- tests/exprs/tstmtexprs.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/exprs/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim index 497a2f6d0..8149ec4b8 100644 --- a/tests/exprs/tstmtexprs.nim +++ b/tests/exprs/tstmtexprs.nim @@ -69,3 +69,15 @@ proc semiProblem() = if false: echo "aye"; echo "indeed" semiProblem() + + +# bug #844 + +import json +proc parseResponse(): PJsonNode = + result = % { "key1": % { "key2": % "value" } } + for key, val in result["key1"]: + var excMsg = key & "(" + if (var n=result["key2"]; n != nil): + excMsg &= n.str + raise newException(ESynch, excMsg) -- cgit 1.4.1-2-gfad0