bugfixes: objects still invalid for constants; fixed a typo concerning 'high' in eval context

This commit is contained in:
Araq 2011-11-15 23:03:14 +01:00
commit 7819b84475
8 changed files with 52 additions and 15 deletions

View file

@ -16,7 +16,7 @@ proc action3(arg: string) =
proc action4(arg: string) =
echo "action 4 ", arg
const
var
actionTable = {
"A": action1,
"B": action2,

View file

@ -0,0 +1,28 @@
discard """
line: 21
errormsg: "invalid type: 'TTable'"
"""
import tables
proc action1(arg: string) =
echo "action 1 ", arg
proc action2(arg: string) =
echo "action 2 ", arg
proc action3(arg: string) =
echo "action 3 ", arg
proc action4(arg: string) =
echo "action 4 ", arg
const
actionTable = {
"A": action1,
"B": action2,
"C": action3,
"D": action4}.toTable
actionTable["C"]("arg")