diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-05-28 22:40:28 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-05-28 22:40:28 +0200 |
commit | e65c89ee28a8b03e00f5dba9ff181918764d72c0 (patch) | |
tree | 5f01f713d85dd8f502e7873248782b30c3fb9bfb /tests/usingstmt | |
parent | ab08ee1ce63a0f8f48026aeeaf07a8a9236ca17e (diff) | |
download | Nim-e65c89ee28a8b03e00f5dba9ff181918764d72c0.tar.gz |
fixes #4177
Diffstat (limited to 'tests/usingstmt')
-rw-r--r-- | tests/usingstmt/tthis.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/usingstmt/tthis.nim b/tests/usingstmt/tthis.nim new file mode 100644 index 000000000..83d75d08c --- /dev/null +++ b/tests/usingstmt/tthis.nim @@ -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 |