You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
templateanyIt*(s, pred: untyped): bool=varresult=falsefor it {.inject.} initems(s):
if pred:
result=truebreakresultlet path ="hello.backup"if ["backup", "orig", "old2", "old", ".1"].anyIt(it in path): echo"wow"
❰dian❙~/Projects/nim-snippets(git:master)❱✔≻ nimsuggest --stdin a.nim
> chk a.nim
chk skUnknown Hint ??? 0 -1 "a [Processing]" 0
chk skUnknown Error /home/dian/Projects/nim-snippets/a.nim 10 52 "type mismatch: got <string, string>\x0Abut expected one of: \x0Aproc contains[T](a: openArray[T]; item: T): bool\x0A first type mismatch at position: 2\x0A required type for item: T\x0A but expression \'it\' is of type: string\x0A2 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them\x0A\x0Aexpression: contains(path, it)" 0
chk skUnknown Error /home/dian/Projects/nim-snippets/a.nim 10 52 "expression \'\' has no type (or is ambiguous)" 0
>
The text was updated successfully, but these errors were encountered:
I don't think this is a bug, you're missing an import strutils at the top, as in is sugar for contains, and the particular implementation you're looking for is defined within the strutils module.
The text was updated successfully, but these errors were encountered: