nimpylib / pylib

"Write Python in Nim!" Python builtins/standard-Lib functions ported to Nim
https://nimpylib.github.io/pylib/
MIT License
9 stars 0 forks source link

Inline filter for toSeq causes deadloop #3

Open litlighilit opened 5 months ago

litlighilit commented 5 months ago

Desc

import pylib
import std/sequtils
discard filter(None, [1,0,3]).toSeq  # <-- deadloop here

Version

Nim: any pylib: 0.9.0

Possible Solution

There is a workaround, see below.

Additional Info

If using closure, then everthing is fine:

let filt = filter(None, [1, 0, 3])
discard filt.toSeq