Skip to content

Instantly share code, notes, and snippets.

@ReneSac
Created January 20, 2014 22:09
Show Gist options
  • Save ReneSac/8c2a4f992baede3e03ca to your computer and use it in GitHub Desktop.
Save ReneSac/8c2a4f992baede3e03ca to your computer and use it in GitHub Desktop.
Error: got (seq[typedesc[int]]) but expected 'seq[int]
proc works(s: seq[int], max:int) : seq[int] =
result = newseq[int](max)
proc fails(s: seq, max:int) : seq[int] =
result = newseq[int](max)
let s = newseq[int](1)
let x = works(s, 1)
let y = fails(s, 1)
#error.nim(9, 13) Info: instantiation from here
#error.nim(5, 22) Error: type mismatch: got (seq[typedesc[int]]) but expected 'seq[int]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment