From baeec118088fa3c40e12271f9ee89a2d701db818 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 4 Aug 2016 23:34:58 +0200 Subject: fixes #4354 --- tests/ccgbugs/tinefficient_const_table.nim | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/ccgbugs/tinefficient_const_table.nim (limited to 'tests/ccgbugs') diff --git a/tests/ccgbugs/tinefficient_const_table.nim b/tests/ccgbugs/tinefficient_const_table.nim new file mode 100644 index 000000000..149b8bcff --- /dev/null +++ b/tests/ccgbugs/tinefficient_const_table.nim @@ -0,0 +1,27 @@ +discard """ + output: '''a +long +list +of +words''' + cmd: r"nim c --hints:on $options -d:release $file" + ccodecheck: "! @'genericSeqAssign'" +""" + + +# bug #4354 +import tables +import sets +import strutils + +#const FRUITS = ["banana", "apple", "grapes"] +#let FRUITS = ["banana", "apple", "grapes"].toSet +const FRUITS = {"banana":0, "apple":0, "grapes":0}.toTable + +proc main() = + let L = "a long list of words".split() + for word in L: + if word notin FRUITS: + echo(word) + +main() -- cgit 1.4.1-2-gfad0