summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-13 14:07:28 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-13 16:33:43 +0200
commit3a5edd2c6c61ce06cd780de2b53d6839fac71d7c (patch)
tree2c0b36d0be92252d92301c8105fb7b9805ff894e /tests
parent03768e7da08c5f37a56b738c61c33b6ed7121a05 (diff)
downloadNim-3a5edd2c6c61ce06cd780de2b53d6839fac71d7c.tar.gz
fixes #4671
Diffstat (limited to 'tests')
-rw-r--r--tests/overload/tselfderef.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/overload/tselfderef.nim b/tests/overload/tselfderef.nim
new file mode 100644
index 000000000..708e4043b
--- /dev/null
+++ b/tests/overload/tselfderef.nim
@@ -0,0 +1,17 @@
+# bug #4671
+{.experimental.}
+{.this: self.}
+
+type
+  SomeObj = object
+    f: int
+
+proc f(num: int) =
+  discard
+
+var intptr: ptr int
+intptr.f() # compiles fine
+
+proc doSomething(self: var SomeObj) =
+  var pint: ptr int
+  pint.f() # Error: expression '.(pint, "f")' cannot be called