-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for https://github.com/nim-lang/Nim/pull/15545 #177
Conversation
This shouldn't have been merged, the PR it refers to wasn't accepted and there is a better way to do this. Besides this breaks "nimpy" for the 1.2.x line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yglukhov Just to let you know that after the changes in this PR, nimpy
is now broken on our CIs for Nim 1.2.x and 1.0.x branches.
(EDIT: ah, Araq was faster than me :))
I've got no strong opinion about how it should be done. Just tell me if I should revert it :) |
if this PR is reverted can we backport
which one besides making the code more complicated / potentially less efficient / less type-checked with something like: case expr
of f1: ...
of f2: ...
of f3: ...
=>
template handleF3() = ...
let x = expr
case x
of f1: ...
of f2: ...
else:
when isOldEnum:
if x == f3:
handleF3()
else: doAssert false # checking whether it's exhaustive is now only RT, not CT
else:
case x
of f3: handleF3()
of f4: ...
of f5: ...
else: doAssert false # ditto (done this way to keep code DRY) (see also nim-lang/Nim#15646 (comment)) |
yes :) |
Reverted |
fix for nim-lang/Nim#15545 ; it's the only important_package that was broken under nim-lang/Nim#15545
trailing else was implemented here: nim-lang/Nim#14190