summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-04-11 07:25:41 -0500
committerGitHub <noreply@github.com>2021-04-11 14:25:41 +0200
commitceadf54d7649b8cc728fd0b6df966bbf28bf55bd (patch)
tree4106775d096082764b3c614ee74b44e21c23988a /lib/system.nim
parenta5b30c94c2dcd0f17b37685d9ce96eee959ba554 (diff)
downloadNim-ceadf54d7649b8cc728fd0b6df966bbf28bf55bd.tar.gz
iterable[T] (#17196)
* fix failing test toSeq in manual which now works
* changelog
* reject proc fn(a: iterable)
* add iterable to spec
* remove MCS/UFCS limitation that now works
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index bd9ae2762..6e84aca66 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -123,6 +123,10 @@ proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
   ##     # Do here programmer friendly expensive sanity checks.
   ##   # Put here the normal code
 
+when defined(nimHasIterable):
+  type
+    iterable*[T] {.magic: IterableType.}  ## Represents an expression that yields `T`
+
 when defined(nimHashOrdinalFixed):
   type
     Ordinal*[T] {.magic: Ordinal.} ## Generic ordinal type. Includes integer,