Add hasClosure to std/typetraits (#17501)
* fix nim js cmp fails at CT * Add `hasClosure` to `std/effecttraits` * type * Update changelog.md Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/std/effecttraits.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
parent
04520c0ce4
commit
81e54c1d30
4 changed files with 109 additions and 0 deletions
|
|
@ -316,3 +316,7 @@ proc registerAdditionalOps*(c: PCtx) =
|
|||
let fn = getNode(a, 0)
|
||||
setResult(a, (fn.typ != nil and tfNoSideEffect in fn.typ.flags) or
|
||||
(fn.kind == nkSym and fn.sym.kind == skFunc))
|
||||
|
||||
registerCallback c, "stdlib.typetraits.hasClosureImpl", proc (a: VmArgs) =
|
||||
let fn = getNode(a, 0)
|
||||
setResult(a, fn.kind == nkClosure or (fn.typ != nil and fn.typ.callConv == ccClosure))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue