summary refs log tree commit diff stats
path: root/tests/vm/tconsttable.nim
blob: 64a74a59d589da96900f67ae6c300cf8fe94d149 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''is
finally
nice!'''
"""

import tables

const
  foo = {"ah": "finally", "this": "is", "possible.": "nice!"}.toTable()

# protect against overly smart compiler:
var x = "this"

echo foo[x]
x = "ah"
echo foo[x]
x = "possible."
echo foo[x]