summary refs log blame commit diff stats
path: root/tests/dll/nimhcr_0_2.nim
blob: 9ce228dc166480ae9e30aa9fe5020791ac3e1a3a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                          
import hotcodereloading

import nimhcr_1 # new import!

# global scope for this module was executed when loading the program
# with a previous version which didn't contain this print statement
echo "   0: I SHOULDN'T BE PRINTED!"

var g_0 = 0 # changed value but won't take effect

proc getInt*(): int = return g_0 + g_1 + f_1()

beforeCodeReload:
  echo "   0: before - improved!" # changed handlers!
afterCodeReload:
  echo "   0: after - improved!"
  g_0 = 100 # we cannot change it in its initialization but we can in the 'after' handler!