summary refs log tree commit diff stats
path: root/tests/usingstmt/tthis.nim
blob: 83d75d08c7687d5db903b449faa71a9898674ea1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 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