SciNim / nimcuda

Nim bindings for CUDA
Apache License 2.0
42 stars 9 forks source link

Exhaustive case over enum doesn't work with 'else' as of Nim 0.20 #6

Closed singularperturbation closed 5 years ago

singularperturbation commented 5 years ago
  Executing task fft in /home/foobar/programming/nimcuda/nimcuda.nimble
  Verifying dependencies for nimcuda@0.1.5
  Compiling examples/fft.nim (from package nimcuda) using c backend
/home/foobar/programming/nimcuda/nimcuda/driver_types.nim(796, 39) Warning: type pragmas follow the type name; this form of writing pragmas is deprecated [Deprecated]
/home/foobar/programming/nimcuda/nimcuda/cuda_occupancy.nim(461, 5) Error: invalid else, all cases are already covered
     Error: Execution failed with exit code 1
        ... Command: "/home/foobar/.nimble/bin/nim" c --noNimblePath "--linetrace:on" "--clibdir:/usr/local/cuda/lib64" "--cincludes:/usr/local/cuda/include" "--stacktrace:on" "--hints:off" "--run" "--path:." "--linedir:on" "--debuginfo"  "examples/fft.nim"

As of Nim 0.20.0, adding an 'else' if switching over an enum (and all cases are already covered) is an error.

Fixed by #5

andreaferretti commented 5 years ago

Accepted your PR, thank you!

erhlee-bird commented 5 years ago

Any chance a new release could be made including this change? I've run into this problem and luckily had an easy way to patch locally but it would be nice to have it fixed upstream as well.

andreaferretti commented 5 years ago

Sure, just did a version bump to 0.1.6