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
typeLoopable*[T] =concept x
x.len() isint
x[int] is T
x.items is T
iteratorloop*[T](a: Loopable[T]): T =#TODO cannot access fields in iteratorfor each in a:
yield each
typeElem*=object
baa*: stringprocfoo(elems: seq[Elem]): string=for elem in elems.loop():
result&="\n"result&=$(elem.baa) #TODO Error: undeclared field: 'baa'result&="\n"let elems =@[Elem(baa: "one"), Elem(baa: "two")]
echofoo(elems)
Current Output
Error: undeclared field: 'baa'
Expected Output
one
two
Additional Information
nim --version
Nim Compiler Version 1.4.8 [Windows: amd64]
Compiled at 2021-05-25
Copyright (c) 2006-2021 by Andreas Rumpf
nim --version
Nim Compiler Version 1.5.1 [Windows: amd64]
Compiled at 2021-09-01
Copyright (c) 2006-2021 by Andreas Rumpf
The text was updated successfully, but these errors were encountered:
Example
Current Output
Expected Output
Additional Information
The text was updated successfully, but these errors were encountered: