fixes #4177
This commit is contained in:
parent
ab08ee1ce6
commit
e65c89ee28
2 changed files with 19 additions and 2 deletions
15
tests/usingstmt/tthis.nim
Normal file
15
tests/usingstmt/tthis.nim
Normal file
|
|
@ -0,0 +1,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
|
||||
Loading…
Add table
Add a link
Reference in a new issue