summary refs log tree commit diff stats
path: root/tests/overload/tselfderef.nim
blob: 96f1da42adbcca28aabaed560bccb42fd5ace8f9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
action: compile
"""

# 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