fixes #4564
This commit is contained in:
parent
186bfe4475
commit
6d98c717de
3 changed files with 15 additions and 3 deletions
|
|
@ -752,14 +752,16 @@ proc semIndirectOp(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
var prc = n.sons[0]
|
var prc = n.sons[0]
|
||||||
if n.sons[0].kind == nkDotExpr:
|
if n.sons[0].kind == nkDotExpr:
|
||||||
checkSonsLen(n.sons[0], 2)
|
checkSonsLen(n.sons[0], 2)
|
||||||
n.sons[0] = semFieldAccess(c, n.sons[0])
|
let n0 = semFieldAccess(c, n.sons[0])
|
||||||
if n.sons[0].kind == nkDotCall:
|
if n0.kind == nkDotCall:
|
||||||
# it is a static call!
|
# it is a static call!
|
||||||
result = n.sons[0]
|
result = n0
|
||||||
result.kind = nkCall
|
result.kind = nkCall
|
||||||
result.flags.incl nfExplicitCall
|
result.flags.incl nfExplicitCall
|
||||||
for i in countup(1, sonsLen(n) - 1): addSon(result, n.sons[i])
|
for i in countup(1, sonsLen(n) - 1): addSon(result, n.sons[i])
|
||||||
return semExpr(c, result, flags)
|
return semExpr(c, result, flags)
|
||||||
|
else:
|
||||||
|
n.sons[0] = n0
|
||||||
else:
|
else:
|
||||||
n.sons[0] = semExpr(c, n.sons[0], {efInCall})
|
n.sons[0] = semExpr(c, n.sons[0], {efInCall})
|
||||||
let t = n.sons[0].typ
|
let t = n.sons[0].typ
|
||||||
|
|
|
||||||
3
tests/template/mlt.nim
Normal file
3
tests/template/mlt.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
type Point* = ref object of RootObj
|
||||||
|
proc `>`*(p1, p2: Point): bool = false
|
||||||
7
tests/template/tlt.nim
Normal file
7
tests/template/tlt.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
import mlt
|
||||||
|
# bug #4564
|
||||||
|
type Bar* = ref object of RootObj
|
||||||
|
proc foo(a: Bar): int = 0
|
||||||
|
var a: Bar
|
||||||
|
let b = a.foo() > 0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue