mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-25 08:43:58 +00:00
fixes #4354
This commit is contained in:
27
tests/ccgbugs/tinefficient_const_table.nim
Normal file
27
tests/ccgbugs/tinefficient_const_table.nim
Normal file
@@ -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()
|
||||
Reference in New Issue
Block a user