This commit is contained in:
Andreas Rumpf
2016-09-13 14:07:28 +02:00
parent 03768e7da0
commit 3a5edd2c6c
2 changed files with 18 additions and 0 deletions

View File

@@ -215,6 +215,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
if result.state != csMatch:
n.sons.delete(1)
orig.sons.delete(1)
excl n.flags, nfExprCall
else: return
if nfDotField in n.flags:

View File

@@ -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