Skip to content

Instantly share code, notes, and snippets.

@zah

zah/test.nim Secret

Last active August 29, 2015 13:57
Show Gist options
  • Save zah/9f925779e27ec515e4b1 to your computer and use it in GitHub Desktop.
Save zah/9f925779e27ec515e4b1 to your computer and use it in GitHub Desktop.
type
TData = tuple
letters: seq[string]
numbers: seq[int
const data: TData = (@["aa", "bb"], @[11, 22])
static:
# the code works with the following line, because in semVarOrLet fitNode is used, which
# produces nkHiddenConv for the tuple type
var m: TData = data
# but the following version won't work
# (no nkHiddenConv is produced and the VM crashes while executing it)
# var m = data
for x in m.letters:
echo x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment