Skip to content

Instantly share code, notes, and snippets.

@auxym
Created December 8, 2018 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auxym/5d41ff558e8d5cc5258f653e5dbdd2c9 to your computer and use it in GitHub Desktop.
Save auxym/5d41ff558e8d5cc5258f653e5dbdd2c9 to your computer and use it in GitHub Desktop.
Nim compiler warnings on date parsing
import seqUtils
import times

proc parseMyDates(line: string): DateTime =
    let rtime: DateTime = parse(line, "yyyy-MM-dd")
    return rtime

var dateStrings = @["2018-12-01", "2018-12-02", "2018-12-03"]
var parsed: seq[DateTime] = dateStrings.map(parseMyDates)

Compiler warnings

scratch.nim(9, 25) template/generic instantiation of `map` from here
/usr/lib/nim/pure/collections/sequtils.nim(238, 10) Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment