unittest.check and sequtils.allIt do not work together #4494

liori opened this Issue Jul 17, 2016 · 0 comments


None yet

1 participant

liori commented Jul 17, 2016

As far as I understand the documentation, the following MWE should compile:

import unittest
from sequtils import allIt

test "Uniqueness check":
  var tags = @[1, 2, 3, 4, 5]
    allIt(0..3, tags[it] != tags[it + 1])

However, I'm getting a compile error:

/home/liori/Studia/Projekty/nim-env/imap/bug2.nim(4, 6) template/generic instantiation from here
/home/liori/Studia/Projekty/nim-env/imap/bug2.nim(6, 3) template/generic instantiation from here
/home/liori/Studia/Projekty/nim-env/imap/bug2.nim(7, 22) Error: undeclared identifier: 'it'
Process terminated with exit code 256

If I change check into discard, it compiles fine.

@Araq Araq added a commit that closed this issue Jul 22, 2016
@Araq Araq fixes #4494 fc0bb82
@Araq Araq closed this in fc0bb82 Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment