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
Compiler reports internal error. (Found when working on #15612).
Example
templatedeclare(body: untyped) =iftrue:
body
else:
body
iteratorsearch(): int {.closure.} =yield11iteratorwalk(): int=declare():
yield0templateprocess(iter: untyped) =for x in iter:
echo x
for _ inwalk():
process(search())
Current Output
Error: internal error: expr: var not init search_385876041
Expected Output
to compile
Possible Solution
Additional Information
nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2020-11-09
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 53eca459f1d96c710238be95bd3fb048b336f2f3
active boot switches: -d:release
Interestingly, this code works with small modifications such as:
if make search normal iterator
if make walk closure iterator
if change if ... body else: body to just body in declare
The text was updated successfully, but these errors were encountered:
Compiler reports internal error. (Found when working on #15612).
Example
Current Output
Expected Output
to compile
Possible Solution
Additional Information
Interestingly, this code works with small modifications such as:
search
normal iteratorwalk
closure iteratorif ... body else: body
to justbody
indeclare
The text was updated successfully, but these errors were encountered: