diff options
author | Jake Leahy <jake@leahy.dev> | 2023-06-26 23:07:42 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 15:07:42 +0200 |
commit | 43a3de9077955031e55691ebb84ee958f6aa260e (patch) | |
tree | a83171f9fdea667c36d18c7c7a9bcb15bfae0f61 /tests | |
parent | 3e44d5742fe7fb54d91465320ee19cb613ae0b46 (diff) | |
download | Nim-43a3de9077955031e55691ebb84ee958f6aa260e.tar.gz |
Fix regression in `std/times` (#22155)
* Add simple test case Just so the regression doesn't happen again * Specify initDateTime is gcsafe in the forward declarations
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/ttimes.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim index 5794fa739..e01ab3a4f 100644 --- a/tests/stdlib/ttimes.nim +++ b/tests/stdlib/ttimes.nim @@ -766,3 +766,7 @@ block: # ttimes check dt.format("GGGG") == "2023" check dt.format("dddd 'KW'V GGGG") == "Thursday KW1 2023" + block: # Can be used inside gcsafe proc + proc test(): DateTime {.gcsafe.} = + result = "1970".parse("yyyy") + doAssert test().year == 1970 |