Skip to content

Instantly share code, notes, and snippets.

@enthus1ast
Created April 11, 2018 11:26
Show Gist options
  • Save enthus1ast/27e45da51cc23639eb678bae6673d9bd to your computer and use it in GitHub Desktop.
Save enthus1ast/27e45da51cc23639eb678bae6673d9bd to your computer and use it in GitHub Desktop.
import times
import options
type
Entry = object of RootObj
emergeDate: Option[DateTime]
publishDate: Option[DateTime]
proc newEntry(): Entry =
# Gives: Error: fields not initialized: emergeDate, publishDate.
result = Entry()
## Gives: Error: cannot instantiate: 'none[DateTime]'
#result = Entry(emergeDate: none[DateTime](), publishDate: none[DateTime]())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment