first implementation of the 'func' keyword

This commit is contained in:
Andreas Rumpf 2017-09-23 23:22:53 +02:00
commit 1a61c4d46d
31 changed files with 97 additions and 84 deletions

View file

@ -248,6 +248,8 @@ proc markWriteOrEscape(w: var W) =
for p in a.dest:
if p.kind == skParam and p.owner == w.owner:
incl(p.flags, sfWrittenTo)
if w.owner.kind == skFunc and p.typ.kind != tyVar:
localError(a.info, "write access to non-var parameter: " & p.name.s)
if {rootIsResultOrParam, rootIsHeapAccess, markAsEscaping}*a.destInfo != {}:
var destIsParam = false