fixes #10942. Lent T bug (#10946)

* fixes #10942

* add test

* bug build
This commit is contained in:
cooldome 2019-04-03 14:55:53 +01:00 • committed by Andreas Rumpf
commit dc2986789b
5 changed files with 54 additions and 16 deletions

View file

@ -136,7 +136,7 @@ proc genArg(p: BProc, n: PNode, param: PSym; call: PNode): Rope =
elif skipTypes(param.typ, abstractVar).kind in {tyOpenArray, tyVarargs}:
var n = if n.kind != nkHiddenAddr: n else: n.sons[0]
result = openArrayLoc(p, n)
elif ccgIntroducedPtr(p.config, param):
elif ccgIntroducedPtr(p.config, param, call[0].typ[0]):
initLocExpr(p, n, a)
result = addrLoc(p.config, a)
elif p.module.compileToCpp and param.typ.kind == tyVar and