forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
type Iterable[T] = concept x
for value in x:
value is T
func ani[T](iter: Iterable[T]): bool =
result = false
for element in iter:
if bool(element):
return true
discard ani([true, false])$ nim c file.nim
58758 lines; 1.440s; 76.566MiB peakmem; proj: file.nim; out: file [SuccessX]
$ nim cpp file.nim
26606 lines; 0.397s; 32.035MiB peakmem; proj: file.nim; out: file [SuccessX]
$ nim js file.nim
internal error: expr(nkBracketExpr, tyUserTypeClassInst)
No stack traceback available
$Reduced from a library that mimics some Python-like constructs,
works for C/CPP, but compiler crashes for JS targets.