diff options
author | Araq <rumpf_a@web.de> | 2018-08-27 17:05:20 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-27 17:07:12 +0200 |
commit | a60cf221e8c116f9b212b69ad52e594ec43bffe4 (patch) | |
tree | 63d7d86f71eab81be80859e521cde3f64803208c /compiler | |
parent | c1df195b15dcc5066bf4a15848cbf199223459a9 (diff) | |
download | Nim-a60cf221e8c116f9b212b69ad52e594ec43bffe4.tar.gz |
improve the error message for mutability problems that arise from implicit converter calls
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semcall.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 980cfb691..00b591632 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -138,7 +138,9 @@ proc effectProblem(f, a: PType; result: var string) = proc renderNotLValue(n: PNode): string = result = $n - if n.kind in {nkHiddenStdConv, nkHiddenSubConv, nkHiddenCallConv} and n.len == 2: + if n.kind == nkHiddenCallConv and n.len > 1: + result = $n[0] & "(" & result & ")" + elif n.kind in {nkHiddenStdConv, nkHiddenSubConv} and n.len == 2: result = typeToString(n.typ.skipTypes(abstractVar)) & "(" & result & ")" proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors): |