Fix `XDeclaredButNotUsed` warning when locks or rlocks module is used
This commit is contained in:
parent
d836028fe7
commit
ebc02f6dc0
4 changed files with 28 additions and 30 deletions
|
|
@ -2561,6 +2561,16 @@ else:
|
|||
if x < 0: -x else: x
|
||||
{.pop.}
|
||||
|
||||
proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect, compileTime.} =
|
||||
## Special compile-time procedure that checks whether `x` can be compiled
|
||||
## without any semantic error.
|
||||
## This can be used to check whether a type supports some operation:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## when not compiles(3 + 4):
|
||||
## echo "'+' for integers is available"
|
||||
discard
|
||||
|
||||
when not defined(JS): #and not defined(nimscript):
|
||||
{.push stack_trace: off, profiler:off.}
|
||||
|
||||
|
|
@ -3469,16 +3479,6 @@ when hasAlloc:
|
|||
x[j+i] = item[j]
|
||||
inc(j)
|
||||
|
||||
proc compiles*(x: expr): bool {.magic: "Compiles", noSideEffect, compileTime.} =
|
||||
## Special compile-time procedure that checks whether `x` can be compiled
|
||||
## without any semantic error.
|
||||
## This can be used to check whether a type supports some operation:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## when not compiles(3 + 4):
|
||||
## echo "'+' for integers is available"
|
||||
discard
|
||||
|
||||
when declared(initDebugger):
|
||||
initDebugger()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue