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
This commit is contained in:
Jake Leahy
2023-06-26 23:07:42 +10:00
committed by GitHub
parent 3e44d5742f
commit 43a3de9077
2 changed files with 6 additions and 2 deletions

View File

@@ -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