diff options
author | Viktor Kirilov <vik.kirilov@gmail.com> | 2020-04-25 21:17:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 20:17:33 +0200 |
commit | 018e297d66f817ef11c409df1ddf7241b451bf09 (patch) | |
tree | f3f7c2a593543175604e5f17e98477eb3c03db74 /tests | |
parent | 362c8964bfbc675efbb054ed2c81396697706309 (diff) | |
download | Nim-018e297d66f817ef11c409df1ddf7241b451bf09.tar.gz |
HCR: properly handling complex const objects in the codegen - fixes #13915 (#14115)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dll/nimhcr_0_3.nim | 1 | ||||
-rw-r--r-- | tests/dll/nimhcr_2_1.nim | 2 | ||||
-rw-r--r-- | tests/dll/nimhcr_integration.nim | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/tests/dll/nimhcr_0_3.nim b/tests/dll/nimhcr_0_3.nim index 56f66e08c..183424e11 100644 --- a/tests/dll/nimhcr_0_3.nim +++ b/tests/dll/nimhcr_0_3.nim @@ -14,5 +14,6 @@ let c = makeCounter() afterCodeReload: echo " 0: after - closure iterator: ", c() echo " 0: after - closure iterator: ", c() + echo " 0: after - c_2 = ", c_2 proc getInt*(): int = return g_1 + g_2.len diff --git a/tests/dll/nimhcr_2_1.nim b/tests/dll/nimhcr_2_1.nim index faafb1f76..705ed6d5a 100644 --- a/tests/dll/nimhcr_2_1.nim +++ b/tests/dll/nimhcr_2_1.nim @@ -7,6 +7,8 @@ type let g_2* = @[Type2(data: 2), Type2(data: 3)][1..^1] # should have a length of 1 +const c_2* = [1, 2, 3] # testing that a complext const object is properly exported + var a: tuple[str: string, i: int] a.str = " 2: random string" echo a.str diff --git a/tests/dll/nimhcr_integration.nim b/tests/dll/nimhcr_integration.nim index 3f73341be..f6c6d21bc 100644 --- a/tests/dll/nimhcr_integration.nim +++ b/tests/dll/nimhcr_integration.nim @@ -36,6 +36,7 @@ max mutual recursion reached! bar 0: after - closure iterator: 0 0: after - closure iterator: 1 + 0: after - c_2 = [1, 2, 3] main: after The answer is: 9 main: hasAnyModuleChanged? true |