-
Notifications
You must be signed in to change notification settings - Fork 25
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
unblock nim https://github.com/nim-lang/Nim/pull/17807 typeof(voidExpr) #193
unblock nim https://github.com/nim-lang/Nim/pull/17807 typeof(voidExpr) #193
Conversation
The The whole EDIT: or maybe your new typeOrVoid tests only the return value type anyway? In that case we could also drop the parens/call. Sorry...Early in the AM here. |
that would have different semantics from the code before this PR, because it'd then consider the function type (not the expression/statement resulting in evaluating p); this PR should still be correct (ie preserving the semantics) but the p() still looks funky, unless there are other options too, eg a |
@c-blake oh btw, can you please push a new tag? the reason being, CI still fails, see https://github.com/nim-lang/Nim/pull/17807/checks?check_run_id=2399022131 , and I'm suspecting it's because it picks latest tagged release which doesn't pickup HEAD of cligen for these packages that depend on cligen: nimterop, prologue (see nim-lang/Nim#17807) not 100% sure whether this will fix CI but worth trying |
Yeah, yeah. The PR works ok. I was just trying to explain/motivate the funkiness of the I have some edits to your fix (when |
So, I stamped a new version number for you. Anyway, this Making Your Also I doubt anyone out there is likely to call a You said you wrote your own private cligen-like thing. What did you do? I imagine one could also just factor out the help string construction from argument parsing and not have to call the dispatcher for the effect of dumping help. Or also just not do that in a multi-command. Anyway, I'm not against cleaning that up, but it also seems not urgent. |
thanks, that did the trick, CI became green (until i added a changelog with
just checked, i'm not handling this properly, but should (probably with |
Yeah... |
(In general my same call site vs. def site observation may motivate having |
Something like `discarder` (maybe under another name) could be in stdlib. `macros` may be an ok place since it non-generic code wants to catch not suppress a mistaken `discard`, but it could apply to templates/generics as well. I am unsure how common it is for generic code to call a proc only for its side-effects, though it is used twice in `cligen`.
Well, I went with |
Well, I just punched a new release for unrelated reasons with the new fix. Hopefully I don't break the Nim CI... |
* `typeof(voidStmt)` now works * remove typeOrVoid * add condsyms, and reference cligen c-blake/cligen#193 * fixup * changelog [skip ci] * fixup
* `typeof(voidStmt)` now works * remove typeOrVoid * add condsyms, and reference cligen c-blake/cligen#193 * fixup * changelog [skip ci] * fixup
/cc @c-blake
that was the only package that broke in nim-lang/Nim#17807; the code here is forward and backward compatible wrt nim-lang/Nim#17807, and is regardless of nim-lang/Nim#17807 an improvement as it avoids a call to
compiles()
which causes extra compilation for the underlying expressionthe
p()
incompiles(type(p()))
seems suspicious given thatp
is apparently called also viap(hlp, usage=use, prefix=pfx, skipHelp=skipHlp, noHdr=noUHdr)
, but that's a pre-existing issue unrelated to this PR