mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
.partial object field names are left unmangled; mangling should be done by the macro instead
This commit is contained in:
@@ -485,7 +485,7 @@ proc fillPartialObject(c: PContext; n: PNode; typ: PType) =
|
||||
let y = considerQuotedIdent(n[1])
|
||||
let obj = x.typ.skipTypes(abstractPtrs)
|
||||
if obj.kind == tyObject and tfPartial in obj.flags:
|
||||
let field = newSym(skField, getIdent(y.s & $obj.n.len), obj.sym, n[1].info)
|
||||
let field = newSym(skField, getIdent(y.s), obj.sym, n[1].info)
|
||||
field.typ = skipIntLit(typ)
|
||||
field.position = sonsLen(obj.n)
|
||||
addSon(obj.n, newSymNode(field))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
out: '''(foo0: 38, other1: string here)
|
||||
output: '''(foo: 38, other: string here)
|
||||
43'''
|
||||
"""
|
||||
|
||||
@@ -12,7 +12,7 @@ proc my(f: Foo) =
|
||||
let f.foo = 38
|
||||
let f.other = "string here"
|
||||
echo f[]
|
||||
echo f.foo0 + 5
|
||||
echo f.foo + 5
|
||||
|
||||
var g: Foo
|
||||
new(g)
|
||||
|
||||
Reference in New Issue
Block a user