summary refs log tree commit diff stats
path: root/tests/global/tglobal.nim
blob: 84c4510c1f93883ecc02570937660e38ed5066e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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