fixes #4671
This commit is contained in:
parent
03768e7da0
commit
3a5edd2c6c
2 changed files with 18 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
17
tests/overload/tselfderef.nim
Normal file
17
tests/overload/tselfderef.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue