proper order of initialization for .global. variables

This commit is contained in:
Zahary Karadjov 2012-04-10 20:53:44 +03:00
commit a64f03230a
7 changed files with 62 additions and 3 deletions

16
tests/run/tglobal.nim Normal file
View file

@ -0,0 +1,16 @@
discard """
file: "toop1.nim"
output: "in globalaux2: 10\ntotal globals: 2\nint value: 100\nstring value: second"
"""
import globalaux, globalaux2
echo "total globals: ", totalGlobals
globalInstance[int]().val = 100
echo "int value: ", globalInstance[int]().val
globalInstance[string]().val = "first"
globalInstance[string]().val = "second"
echo "string value: ", globalInstance[string]().val