-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Revert adding generic V: Ordinal
parameter to succ
, pred
, inc
, dec
#22328
Conversation
c152265
to
aec81dd
Compare
For some reason I get an assertion failure for the proc default*[T](_: typedesc[T]): T {.magic: "Default", noSideEffect.} =
## Returns the default value of the type `T`. Contrary to `zeroDefault`, it takes default fields
## of an object into consideration.
##
## See also:
## * `zeroDefault <#zeroDefault,typedesc[T]>`_
##
runnableExamples:
assert (int, float).default == (0, 0.0)
type Foo = object
a: range[2..6]
var x = Foo.default
assert x.a == 2 On my fork, the CI doesn't fail. |
Ok, so this change causes |
It's unrelated. Fixed by #22331 |
d3e9e28
to
afc238a
Compare
The CI failure seems to be unrelated. |
just curious, is it suitable change these int32 to int? |
Yes, |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
Since this breaks our own checksums package this needs to be reverted. |
refs nim-lang#22328, fixes regression in https://forum.nim-lang.org/t/12465#76998
refs #22328, fixes regression in https://forum.nim-lang.org/t/12465#76998
refs nim-lang#22328, fixes regression in https://forum.nim-lang.org/t/12465#76998
This was added in #20829, however it wasn't mentioned anywhere. Provided this passes the CI, I don't see why this was changed in the first place. I don't think it makes sense to add/subtract arbitrary
Ordinal
s (which is whatsucc
/pred
currently allow). It also makes codegen more complicated (at least for JS, which is currently broken because of this, I haven't checked for C/C++), since now we can't rely on the second argument being anint
anymore.cc @bung87