diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2019-08-15 06:55:48 -0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-08-15 15:55:48 +0200 |
commit | 511298242da792e342fa0ea9491b77c822df1209 (patch) | |
tree | 5c37cbbeea5617869e6c60e8aa87705488a461c0 /compiler/ccgexprs.nim | |
parent | 296dfae8af61a9ce145affec791ef338b3774950 (diff) | |
download | Nim-511298242da792e342fa0ea9491b77c822df1209.tar.gz |
fixes #10053 (#11951)
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 224054506..6e203dad5 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -825,7 +825,8 @@ proc genFieldCheck(p: BProc, e: PNode, obj: Rope, field: PSym) = v.r.add(".") v.r.add(disc.sym.loc.r) genInExprAux(p, it, u, v, test) - let strLit = genStringLiteral(p.module, newStrNode(nkStrLit, field.name.s)) + let msg = genFieldError(field, disc.sym) + let strLit = genStringLiteral(p.module, newStrNode(nkStrLit, msg)) if op.magic == mNot: linefmt(p, cpsStmts, "if ($1) #raiseFieldError($2);$n", |