mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 02:18:00 +00:00
toplevel .closure procs are deprecated
This commit is contained in:
@@ -1220,6 +1220,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||
if n.sons[patternPos].kind != nkEmpty:
|
||||
c.patterns.add(s)
|
||||
if isAnon: result.typ = s.typ
|
||||
if isTopLevel(c) and s.kind != skClosureIterator and
|
||||
s.typ.callConv == ccClosure:
|
||||
message(s.info, warnDeprecated, "top level '.closure' calling convention")
|
||||
|
||||
proc determineType(c: PContext, s: PSym) =
|
||||
if s.typ != nil: return
|
||||
|
||||
1
todo.txt
1
todo.txt
@@ -1,7 +1,6 @@
|
||||
version 0.11.4
|
||||
==============
|
||||
|
||||
- deprecate toplevel .closure procs
|
||||
- deprecate closure iterator construction via ``var cl = foo``
|
||||
|
||||
- document special cased varargs[untyped] and varargs[typed]
|
||||
|
||||
@@ -46,6 +46,10 @@ News
|
||||
overloaded, so we removed it with no deprecation cycle.
|
||||
- To use the ``parallel`` statement you now have to
|
||||
use the ``--experimental`` mode.
|
||||
- Toplevel procs of calling convention ``closure`` never worked reliably
|
||||
and are now deprecated and will be removed from the language. Instead you
|
||||
have to insert type conversions
|
||||
like ``(proc (a, b: int) {.closure.})(myToplevelProc)`` if necessary.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user