mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
16 lines
331 B
Nim
16 lines
331 B
Nim
|
|
# bug #4177
|
|
|
|
type
|
|
Parent = object of RootObj
|
|
parentField: int
|
|
Child = object of Parent
|
|
childField: int
|
|
|
|
{.this: self.}
|
|
proc sumFields(self: Child): int =
|
|
result = parentField + childField # Error: undeclared identifier: 'parentField'
|
|
|
|
proc sumFieldsWorks(self: Child): int =
|
|
result = self.parentField + childField
|