diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-01-11 12:00:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 18:00:57 +0000 |
commit | 335f849c36c4d7e618de277f6da64d8c1fdcc1c9 (patch) | |
tree | 71f848005095b54f9304ff86fe9ed27fe9d4029d | |
parent | da28df6113cdc552ad2ef3a029638efd9bfdadf2 (diff) | |
download | Nim-335f849c36c4d7e618de277f6da64d8c1fdcc1c9.tar.gz |
close #9901 add testcase (#16662)
* close #9901 add testcase * follow advice
-rw-r--r-- | tests/misc/tproveinit.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/misc/tproveinit.nim b/tests/misc/tproveinit.nim new file mode 100644 index 000000000..c9f688309 --- /dev/null +++ b/tests/misc/tproveinit.nim @@ -0,0 +1,18 @@ +discard """ + joinable: false +""" + +{.warningAsError[ProveInit]:on.} +template main() = + proc fn(): var int = + discard + discard fn() +doAssert not compiles(main()) + +# bug #9901 +import std/[sequtils, times] +proc parseMyDates(line: string): DateTime = + result = parse(line, "yyyy-MM-dd") +var dateStrings = @["2018-12-01", "2018-12-02", "2018-12-03"] +var parsed = dateStrings.map(parseMyDates) +discard parsed |