make 'not nil' experimental

This commit is contained in:
Andreas Rumpf 2018-05-01 10:48:46 +02:00 • committed by Araq
commit 599b5d6dcb
14 changed files with 27 additions and 16 deletions

View file

@ -3223,7 +3223,7 @@ when not defined(JS): #and not defined(nimscript):
when declared(initGC): initGC()
when not defined(nimscript):
proc setControlCHook*(hook: proc () {.noconv.} not nil)
proc setControlCHook*(hook: proc () {.noconv.})
## allows you to override the behaviour of your application when CTRL+C
## is pressed. Only one such hook is supported.

View file

@ -56,7 +56,7 @@ var
# list of exception handlers
# a global variable for the root of all try blocks
currException {.threadvar.}: ref Exception
raise_counter {.threadvar.}: uint
raise_counter {.threadvar.}: uint
gcFramePtr {.threadvar.}: GcFrame
@ -126,10 +126,10 @@ proc popCurrentExceptionEx(id: uint) {.compilerRtl.} =
while cur != nil and cur.raise_id != id:
prev = cur
cur = cur.up
if cur == nil:
if cur == nil:
showErrorMessage("popCurrentExceptionEx() exception was not found in the exception stack. Aborting...")
quitOrDebug()
prev.up = cur.up
prev.up = cur.up
# some platforms have native support for stack traces:
const
@ -503,7 +503,7 @@ when not defined(noSignalHandler) and not defined(useNimRtl):
registerSignalHandler() # call it in initialization section
proc setControlCHook(hook: proc () {.noconv.} not nil) =
proc setControlCHook(hook: proc () {.noconv.}) =
# ugly cast, but should work on all architectures:
type SignalHandler = proc (sign: cint) {.noconv, benign.}
c_signal(SIGINT, cast[SignalHandler](hook))