diff options
author | Araq <rumpf_a@web.de> | 2015-09-10 15:57:57 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-09-10 15:57:57 +0200 |
commit | 63cdcb2be188cfe613edbbcca58e193973b7b9f3 (patch) | |
tree | 1f836d046774d0d05ddcf211020e72b5ca6b569a | |
parent | 34ab1d3e340635620d41ea1b0250830971648dda (diff) | |
download | Nim-63cdcb2be188cfe613edbbcca58e193973b7b9f3.tar.gz |
implicit return types for iterators are now deprecated
-rw-r--r-- | compiler/semtypes.nim | 1 | ||||
-rw-r--r-- | todo.txt | 1 | ||||
-rw-r--r-- | web/news.txt | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 5ae3d16c0..2ee17fcaf 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -970,6 +970,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, elif kind == skIterator: # XXX This is special magic we should likely get rid of r = newTypeS(tyExpr, c) + message(n.info, warnDeprecated, "implicit return type for 'iterator'") if r != nil: # turn explicit 'void' return type into 'nil' because the rest of the diff --git a/todo.txt b/todo.txt index c645f45e9..91c6f1625 100644 --- a/todo.txt +++ b/todo.txt @@ -23,7 +23,6 @@ version 1.0 - nimsuggest: auto-completion needs to work in 'class' macros - The bitwise 'not' operator will be renamed to 'bnot' to prevent 'not 4 == 5' from compiling. -> requires 'mixin' annotation for procs! -- iterators always require a return type - split docgen into separate tool - special rule for ``[]=``, items, pairs - BUG: echo with template `$`*(info: TLineInfo): expr = toFileLineCol(info) diff --git a/web/news.txt b/web/news.txt index aaf3c9385..c786d7d5a 100644 --- a/web/news.txt +++ b/web/news.txt @@ -73,6 +73,8 @@ News multi methods less error-prone to use with the effect system. - Nim's parser directive ``#!`` is now ``#?`` in order to produce no conflicts with Unix's ``#!``. + - An implicit return type for an iterator is now deprecated. Use ``auto`` if + you want more type inference. Library Additions |