thank you! issue added!

contents:

after upgrading to 0.20.0 my app not compiles:

Hint: 378820 [Processing]

/Users/travis/build/nim-lang/nightlies/nim/e7471cebae2a404f3e4239f199f5a0c422484aac/lib/system/fatal.nim(48)
 sysFatal|   
---|---  
  
Error: unhandled exception: value out of range: -1 [RangeError]

i use includes. if replace the include with the file contents it compiles fine. 
(but int.high as enum value throws error) (include throws error even if 
int.high not used)

### Example

nim.cfg
    \--define:channelenabled|   
---|---  
channelhandler.nim:
    

type mainChannelIntCodes = enum
    mciHello = 1, mciQuit = int.high - 1 # int.high gives error too

proc handlechannel*(): <<<<<<<<<<<<<<<

> case inbox.msg: of int(mciQuit): app.quit()

appbase.nim:
    

template mainLoop*[T](app:T, eventhandler: untyped)=
    when channelenabled: handlechannel() <<<<<<<<<<<< eventhandler #! YOUR 
event handler that handles inputLoopEventFlowVar
main.nim:
    import appbase when channelenabled: include channelhandler.nim

app.mainloop:
    # >calls channelhandler() here<

case inputLoopEvent.evType:
    of ...

$ nim -v Nim Compiler Version 0.20.0 [Linux: amd64] Compiled at 2019-06-06

Reply via email to