Files
Nim/tests/usingstmt/tthis.nim
Andreas Rumpf e65c89ee28 fixes #4177
2016-05-28 22:40:28 +02:00

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