diff options
-rw-r--r-- | compiler/semstmts.nim | 2 | ||||
-rw-r--r-- | tests/fields/timplicitfieldswithpartial.nim | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index ad043a6ee..576f2695b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -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)) diff --git a/tests/fields/timplicitfieldswithpartial.nim b/tests/fields/timplicitfieldswithpartial.nim index ab50f4276..996912a1a 100644 --- a/tests/fields/timplicitfieldswithpartial.nim +++ b/tests/fields/timplicitfieldswithpartial.nim @@ -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) |