summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-04-14 06:00:02 -0700
committerGitHub <noreply@github.com>2020-04-14 15:00:02 +0200
commit10eabec6d442cb32c2c74f7c56cc9fff3be40104 (patch)
tree78442d6cd1f5ec66d41a62c5ca31e1512b21c55e /compiler
parentc2699648604cc57cd55ecd7d88ccd55ed38099fb (diff)
downloadNim-10eabec6d442cb32c2c74f7c56cc9fff3be40104.tar.gz
fix #12864 static params were mutating arg types during sigmatch; fix #12713 ; refs #13529 (#13976)
* fix #12864 static params were mutating arg types during sigmatch

* fix test

* fix StaticParam

* also fixes #12713; added test case
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sigmatch.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 04ceb47b8..d819afb42 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -2004,6 +2004,7 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
         let typ = newTypeS(tyStatic, c)
         typ.sons = @[evaluated.typ]
         typ.n = evaluated
+        arg = copyTree(arg) # fix #12864
         arg.typ = typ
         a = typ
       else: