Converter bug fixes (#9700)

* Fixes #9698
* Fixes #9699
This commit is contained in:
cooldome 2018-11-15 12:14:48 +00:00 • committed by Andreas Rumpf
commit c5c4da4f3c
4 changed files with 118 additions and 2 deletions

View file

@ -138,6 +138,7 @@ proc effectProblem(f, a: PType; result: var string) =
proc renderNotLValue(n: PNode): string =
result = $n
let n = if n.kind == nkHiddenDeref: n[0] else: n
if n.kind == nkHiddenCallConv and n.len > 1:
result = $n[0] & "(" & result & ")"
elif n.kind in {nkHiddenStdConv, nkHiddenSubConv} and n.len == 2:
@ -394,6 +395,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
args])
proc instGenericConvertersArg*(c: PContext, a: PNode, x: TCandidate) =
let a = if a.kind == nkHiddenDeref: a[0] else: a
if a.kind == nkHiddenCallConv and a.sons[0].kind == nkSym:
let s = a.sons[0].sym
if s.ast != nil and s.ast[genericParamsPos].kind != nkEmpty: