niv / websocket.nim

websockets for nim
http://niv.github.io/websocket.nim/docs/0.1.1/websocket.html
Other
102 stars 25 forks source link

websocket/shared.nim(265, 5) Error: invalid else, all cases are already covered #51

Closed timotheecour closed 5 years ago

timotheecour commented 5 years ago

bug triggered from another libary (/cc @brentp ) but pointing to here

using nim devel; it now disallows duplicate coverage in case statements

nim --version
Nim Compiler Version 0.19.9 [MacOSX: amd64]
Compiled at 2019-01-25
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: 44923a1b1f158732b13fb938c94c0b02a2463e6d
active boot switches: -d:release
git clone https://github.com/brentp/nim-plotly
cd nim-plotly
nimble test
   Warning: Using env var NIM_LIB_PREFIX: /Users/timothee/git_clone//nim//Nim/
  Executing task test in /Users/timothee/git_clone/nim/nim-plotly/plotly.nimble
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/nim-plotly/examples/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/config.nims' [Conf]
/Users/timothee/git_clone/nim/nim-plotly/examples/all.nim(8, 1) template/generic instantiation from here
/Users/timothee/git_clone/nim/nim-plotly/examples/fig9_heatmap.nim(6, 1) template/generic instantiation from here
/Users/timothee/git_clone/nim/nim-plotly/examples/fig9_heatmap.nim(16, 18) Warning: random is deprecated [Deprecated]
Hint:  [Link]
Hint: operation successful (66280 lines compiled; 1.143 sec total; 91.938MiB peakmem; Debug Build) [SuccessX]
Hint: /Users/timothee/git_clone/nim/nim-plotly/examples/all  [Exec]
/tmp/x.html
/tmp/x.html
/tmp/x.html
/tmp/x.html
/tmp/x.html
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/.config/nim/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/nim-plotly/examples/nim.cfg' [Conf]
Hint: used config file '/Users/timothee/git_clone/nim/Nim/config/config.nims' [Conf]
/Users/timothee/git_clone/nim/nim-plotly/examples/fig12_save_figure.nim(1, 1) template/generic instantiation from here
/Users/timothee/git_clone/nim/nim-plotly/src/plotly.nim(15, 1) template/generic instantiation from here
/Users/timothee/git_clone/nim/nim-plotly/src/plotly/image_retrieve.nim(1, 1) template/generic instantiation from here
/Users/timothee/.nimble/pkgs/websocket-0.3.4/websocket/shared.nim(221, 51) template/generic instantiation of `async` from here
/Users/timothee/.nimble/pkgs/websocket-0.3.4/websocket/shared.nim(265, 5) Error: invalid else, all cases are already covered
stack trace: (most recent call last)
/Users/timothee/git_clone/nim/nim-plotly/plotly.nimble(18, 8) testTask
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(241, 7) exec
/Users/timothee/git_clone/nim/Nim/lib/system/nimscript.nim(241, 7) Error: unhandled exception: FAILED: nim c --lineDir:on --debuginfo --threads:on -r examples/fig12_save_figure.nim
timotheecour commented 5 years ago

EDIT: i see https://github.com/niv/websocket.nim/commit/4638d2cb26779b61558ec411e17512fe5ca32396 already fixes this and https://github.com/niv/websocket.nim/commit/e9f79c08d503f41d8032d4cde3a418b183b095d9 already bumped version in nimble file (to 0.3.5) however a release wasn't yet tagged (still at 0.3.4) so nimble install websocket still picks version prior to bugfix

Downloading https://github.com/niv/websocket.nim using git
   Warning: Using env var NIM_LIB_PREFIX: /Users/timothee/git_clone//nim//Nim/
  Verifying dependencies for websocket@0.3.4
 Installing websocket@0.3.4
   Success: websocket installed successfully.

workaround

nimble develop

proper fix

should git tag 0.3.5 @niv

dom96 commented 5 years ago

Just use nimble install websocket@#head

metagn commented 5 years ago

Tagged 0.3.5