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
This commit is contained in:
Timothee Cour
2020-04-14 06:00:02 -07:00
committed by GitHub
parent c269964860
commit 10eabec6d4
6 changed files with 77 additions and 6 deletions

View File

@@ -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: