'func' is now an alias for 'proc .noSideEffect'
This commit is contained in:
parent
a17d45c2c2
commit
ea8afebf8c
2 changed files with 10 additions and 7 deletions
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
- Dot calls combined with explicit generic instantiations can now be written
|
- Dot calls combined with explicit generic instantiations can now be written
|
||||||
as ``x.y[:z]``. ``x.y[:z]`` that is transformed into ``y[z](x)`` in the parser.
|
as ``x.y[:z]``. ``x.y[:z]`` that is transformed into ``y[z](x)`` in the parser.
|
||||||
|
- ``func`` is now an alias for ``proc {.noSideEffect.}``.
|
||||||
|
|
||||||
### Language changes
|
### Language changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1513,7 +1513,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||||
n.sons[patternPos] = semPattern(c, n.sons[patternPos])
|
n.sons[patternPos] = semPattern(c, n.sons[patternPos])
|
||||||
if s.kind == skIterator:
|
if s.kind == skIterator:
|
||||||
s.typ.flags.incl(tfIterator)
|
s.typ.flags.incl(tfIterator)
|
||||||
|
elif s.kind == skFunc:
|
||||||
|
incl(s.flags, sfNoSideEffect)
|
||||||
|
incl(s.typ.flags, tfNoSideEffect)
|
||||||
var proto = searchForProc(c, oldScope, s)
|
var proto = searchForProc(c, oldScope, s)
|
||||||
if proto == nil or isAnon:
|
if proto == nil or isAnon:
|
||||||
if s.kind == skIterator:
|
if s.kind == skIterator:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue