diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-10-02 08:31:38 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-02 08:31:38 +0200 |
commit | e9243a16167b24899d4fcf051f3252b3a5804811 (patch) | |
tree | dc4733a6f178d4f04ee4da33c50ca807eb7e9dd0 /compiler/writetracking.nim | |
parent | fc7961d4ccd31ab6e7eabbeb7aa22b5488924b4f (diff) | |
parent | 02ff5f596c330b68927f843814ecb9b86c2eee67 (diff) | |
download | Nim-e9243a16167b24899d4fcf051f3252b3a5804811.tar.gz |
Merge branch 'devel' into araq
Diffstat (limited to 'compiler/writetracking.nim')
-rw-r--r-- | compiler/writetracking.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/writetracking.nim b/compiler/writetracking.nim index 443e8ddf1..fe71e5b31 100644 --- a/compiler/writetracking.nim +++ b/compiler/writetracking.nim @@ -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 |