'func' is now an alias for 'proc .noSideEffect'

This commit is contained in:
Andreas Rumpf 2018-04-12 17:04:15 +02:00
commit ea8afebf8c
2 changed files with 10 additions and 7 deletions

View file

@ -35,6 +35,7 @@
- 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.
- ``func`` is now an alias for ``proc {.noSideEffect.}``.
### Language changes

View file

@ -1513,7 +1513,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
n.sons[patternPos] = semPattern(c, n.sons[patternPos])
if s.kind == skIterator:
s.typ.flags.incl(tfIterator)
elif s.kind == skFunc:
incl(s.flags, sfNoSideEffect)
incl(s.typ.flags, tfNoSideEffect)
var proto = searchForProc(c, oldScope, s)
if proto == nil or isAnon:
if s.kind == skIterator: