implicit return types for iterators are now deprecated
This commit is contained in:
parent
34ab1d3e34
commit
63cdcb2be1
3 changed files with 3 additions and 1 deletions
|
|
@ -970,6 +970,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
|
||||||
elif kind == skIterator:
|
elif kind == skIterator:
|
||||||
# XXX This is special magic we should likely get rid of
|
# XXX This is special magic we should likely get rid of
|
||||||
r = newTypeS(tyExpr, c)
|
r = newTypeS(tyExpr, c)
|
||||||
|
message(n.info, warnDeprecated, "implicit return type for 'iterator'")
|
||||||
|
|
||||||
if r != nil:
|
if r != nil:
|
||||||
# turn explicit 'void' return type into 'nil' because the rest of the
|
# turn explicit 'void' return type into 'nil' because the rest of the
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -23,7 +23,6 @@ version 1.0
|
||||||
- nimsuggest: auto-completion needs to work in 'class' macros
|
- nimsuggest: auto-completion needs to work in 'class' macros
|
||||||
- The bitwise 'not' operator will be renamed to 'bnot' to
|
- The bitwise 'not' operator will be renamed to 'bnot' to
|
||||||
prevent 'not 4 == 5' from compiling. -> requires 'mixin' annotation for procs!
|
prevent 'not 4 == 5' from compiling. -> requires 'mixin' annotation for procs!
|
||||||
- iterators always require a return type
|
|
||||||
- split docgen into separate tool
|
- split docgen into separate tool
|
||||||
- special rule for ``[]=``, items, pairs
|
- special rule for ``[]=``, items, pairs
|
||||||
- BUG: echo with template `$`*(info: TLineInfo): expr = toFileLineCol(info)
|
- BUG: echo with template `$`*(info: TLineInfo): expr = toFileLineCol(info)
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,8 @@ News
|
||||||
multi methods less error-prone to use with the effect system.
|
multi methods less error-prone to use with the effect system.
|
||||||
- Nim's parser directive ``#!`` is now ``#?`` in order to produce no conflicts
|
- Nim's parser directive ``#!`` is now ``#?`` in order to produce no conflicts
|
||||||
with Unix's ``#!``.
|
with Unix's ``#!``.
|
||||||
|
- An implicit return type for an iterator is now deprecated. Use ``auto`` if
|
||||||
|
you want more type inference.
|
||||||
|
|
||||||
|
|
||||||
Library Additions
|
Library Additions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue