minor bugfixes for 'func' and .borrow
This commit is contained in:
parent
da29222f86
commit
ebd1cc0265
2 changed files with 3 additions and 2 deletions
|
|
@ -1756,7 +1756,7 @@ proc isRoutine*(s: PSym): bool {.inline.} =
|
||||||
|
|
||||||
proc isCompileTimeProc*(s: PSym): bool {.inline.} =
|
proc isCompileTimeProc*(s: PSym): bool {.inline.} =
|
||||||
result = s.kind == skMacro or
|
result = s.kind == skMacro or
|
||||||
s.kind == skProc and sfCompileTime in s.flags
|
s.kind in {skProc, skFunc} and sfCompileTime in s.flags
|
||||||
|
|
||||||
proc isRunnableExamples*(n: PNode): bool =
|
proc isRunnableExamples*(n: PNode): bool =
|
||||||
# Templates and generics don't perform symbol lookups.
|
# Templates and generics don't perform symbol lookups.
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,8 @@ proc searchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym =
|
||||||
x = t.baseOfDistinct
|
x = t.baseOfDistinct
|
||||||
call.add(newNodeIT(nkEmpty, fn.info, x))
|
call.add(newNodeIT(nkEmpty, fn.info, x))
|
||||||
if hasDistinct:
|
if hasDistinct:
|
||||||
var resolved = semOverloadedCall(c, call, call, {fn.kind}, {})
|
let filter = if fn.kind in {skProc, skFunc}: {skProc, skFunc} else: {fn.kind}
|
||||||
|
var resolved = semOverloadedCall(c, call, call, filter, {})
|
||||||
if resolved != nil:
|
if resolved != nil:
|
||||||
result = resolved[0].sym
|
result = resolved[0].sym
|
||||||
if not compareTypes(result.typ[0], fn.typ[0], dcEqIgnoreDistinct):
|
if not compareTypes(result.typ[0], fn.typ[0], dcEqIgnoreDistinct):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue