| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
split again from #24038, fixes
https://github.com/status-im/nimbus-eth2/pull/6554#issuecomment-2354977102
`var`/pointer types are no longer implicitly convertible to each other
if their element types either:
* require an int conversion or another conversion operation as long as
it's not to `openarray`,
* are subtypes with pointer indirection,
Previously any conversion below a subrange match would match if the
element type wasn't a pointer type, then it would error later in
`analyseIfAddressTaken`.
Different from #24038 in that the preview define that made subrange
matches also fail to match is removed for a simpler diff so that it can
be backported.
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #24054
`readData` is not implemented for the VM as mentioned in the issue, but
`readDataStr` is, so that is used for `readStr` instead on the VM. We
could also just use it in general since it falls back to `readData`
anyway but it's kept the same otherwise for now.
Also where and why streams in general don't work in VM is now documented
on the top level `streams` module documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #16376
The way the compiler handled generic proc instantiations in calls (like
`foo[int](...)`) up to this point was to instantiate `foo[int]`, create
a symbol for the instantiated proc (or a symchoice for multiple procs
excluding ones with mismatching generic param counts), then perform
overload resolution on this symbol/symchoice. The exception to this was
when the called symbol was already a symchoice node, in which case it
wasn't instantiated and overloading was called directly ([these
lines](https://github.com/nim-lang/Nim/blob/b7b1313d21deb687adab2b4a162e716ba561a26b/compiler/semexprs.nim#L3366-L3371)).
This has several problems:
* Templates and macros can't create instantiated symbols, so they
couldn't participate in overloaded explicit generic instantiations,
causing the issue #16376.
* Every single proc that can be instantiated with the given generic
params is fully instantiated including the body. #9997 is about this but
isn't fixed here since the instantiation isn't in a call.
The way overload resolution handles explicit instantiations by itself is
also buggy:
* It doesn't check constraints.
* It allows only partially providing the generic parameters, which makes
sense for implicit generics, but can cause ambiguity in overloading.
Here is how this PR deals with these problems:
* Overload resolution now always handles explicit generic instantiations
in calls, in `initCandidate`, as long as the symbol resolves to a
routine symbol.
* Overload resolution now checks the generic params for constraints and
correct parameter count (ignoring implicit params). If these don't
match, the entire overload is considered as not matching and not
instantiated.
* Special error messages are added for mismatching/missing/extra generic
params. This is almost all of the diff in `semcall`.
* Procs with matching generic parameters now instantiate only the type
of the signature in overload resolution, not the proc itself, which also
works for templates and macros.
Unfortunately we can't entirely remove instantiations because overload
resolution can't handle some cases with uninstantiated types even though
it's resolved in the binding (see the last 2 blocks in
`texplicitgenerics`). There are also some instantiation issues with
default params that #24005 didn't fix but I didn't want this to become
the 3rd huge generics PR in a row so I didn't dive too deep into trying
to fix them. There is still a minor instantiation fix in `semtypinst`
though for subscripts in calls.
Additional changes:
* Overloading of `[]` wasn't documented properly, it somewhat is now
because we need to mention the limitation that it can't be done for
generic procs/types.
* Tests can now enable the new type mismatch errors with just
`-d:testsConciseTypeMismatch` in the command.
Package PRs:
- using fork for now:
[combparser](https://github.com/PMunch/combparser/pull/7) (partial
generic instantiation)
- merged: [cligen](https://github.com/c-blake/cligen/pull/233) (partial
generic instantiation but non-overloaded + template)
- merged: [neo](https://github.com/andreaferretti/neo/pull/56) (trying
to instantiate template with no generic param)
|
|
|
| |
ref https://github.com/andreaferretti/neo/pull/55
|
|
|
|
|
|
|
| |
Reverts nim-lang/Nim#23958
follow up https://github.com/nim-lang/Nim/pull/23981
ref https://github.com/nim-lang/Nim/pull/23958#issuecomment-2294848209
|
|
|
| |
ref https://forum.nim-lang.org/t/11587
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds Constantine to the important packages. Release announcements:
- https://forum.nim-lang.org/t/11935
- https://github.com/mratsim/constantine/releases/tag/v0.1.0
Unfortunately at the moment I'm in a conundrum.
- Constantine cannot compile on devel due to
https://github.com/nim-lang/Nim/issues/23547
- The workaround is changing
```Nim
func mulCheckSparse*(a: var QuadraticExt, b: static QuadraticExt)
{.inline.} =
```
to
```Nim
template mulCheckSparse*(a: var QuadraticExt, b: QuadraticExt) =
```
but this does not compile on v2.0.8 due to `gensym` issues despite
https://github.com/nim-lang/Nim/pull/23716
.
i.e. as mentioned in the issue
https://github.com/nim-lang/Nim/issues/23711 there is another gensym bug
within templates that was fixed in devel but not the v2.0.x series and
that is not fixed by #23716
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
Unhandled exception: /home/runner/work/Nim/Nim/pkgstemp/dnsclient/tests/test1.nim(28, 3) `rr.strings == @["dnsclient.nim"]` [AssertionDefect]
[FAILED] query TXT
[OK] query MX
[OK] query CNAME
[OK] query SRV
Error: execution of an external program failed: '/home/runner/work/Nim/Nim/pkgstemp/dnsclient/tests/test1'
Tip: 2 messages have been suppressed, use --verbose to show them.
tools.nim(36) doCmd
Error: Execution failed with exit code 1
... Command: /home/runner/work/Nim/Nim/bin/nim c --noNimblePath -d:NimblePkgVersion=0.3.4 --hints:off -r --path:. /home/runner/work/Nim/Nim/pkgstemp/dnsclient/tests/test1
```
|
|
|
| |
https://github.com/Yardanico/nimpylib is 404 now
|
|
|
|
| |
These packages are some of the dependencies of Nimbus with shorter
testing times.
|
|
|
|
|
| |
platform (#23661)
Cannot compile on Linux reliably
|
|
|
|
|
|
| |
tests untested (#23592)
Targets are not changes, which means the C binary is actually tested for
JS backend
|
|
|
|
|
| |
Reverts nim-lang/Nim#23566
ref
https://github.com/ba0f3/telebot.nim/commit/afe4ad877ec015091f5b6fde32ecb2502fe59a3f
|
| |
|
|
|
|
|
| |
Was introduced to handle a break in #23392, according to
https://github.com/nim-lang/Nim/pull/23503#issuecomment-2057266475
should not be needed anymore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23326
In a routine declaration node in a template, if the routine is marked as
`gensym`, the compiler adds it as a new symbol to a preliminary scope of
the template. If it's not marked as gensym, then it searches the
preliminary scope of the template for the name of the routine, then when
it matches a template parameter or a gensym identifier, the compiler
replaces the name node with a symbol node of the found symbol.
This makes sense for the template parameter since it has to be replaced
later, but not really for the gensym identifier, as it doesn't allow us
to inject a routine with the same name as an identifier previously
declared as gensym (the problem in #23326 is when this is in another
`when` branch).
However this is the only channel to reuse a gensym symbol in a
declaration, so maybe removing it has side effects. For example if we
have:
```nim
proc foo(x: int) {.gensym.} = discard
proc foo(x: float) {.gensym.} = discard
```
it will not behave the same as
```nim
proc foo(x: int) {.gensym.} = discard
proc foo(x: float) = discard
```
behaved previously, which maybe allowed overloading over the gensym'd
symbols.
A note to the "undeclared identifier" error message has also been added
for a potential error code that implicitly depended on the old behavior
might give, namely ``undeclared identifier: 'abc`gensym123'``, which
happens when in a template an identifier is first declared gensym in
code that doesn't compile, then as a routine which injects by default,
then the identifier is used.
|
|
|
|
|
|
| |
Reverts nim-lang/Nim#23352
ref
https://github.com/SciNim/Measuremancer/commit/e2e994b21c162d5c382f04383893f2abb12af51f
|
|
|
| |
ref https://github.com/SciNim/Measuremancer/issues/17
|
|
|
|
|
| |
https://nim-lang.github.io/Nim/testament.html#writing-unit-tests
https://nim-lang.github.io/Nim/testament.html#writing-unit-tests-output-message-variable-interpolation
|
| |
|
|
|
|
|
|
| |
Continued from #23096 which was reverted due to breaking a package and
failing docgen tests. Docgen should now work, but ~~a PR is still
pending for the package: https://github.com/SciNim/Unchained/pull/45~~
has been merged
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code will crash `check`/`nimsuggest` since the `ra` register is
uninitialised
```nim
import macros
static:
discard parseExpr("'")
```
Now it assigns an empty node so that it has something
Testament changes were so I could properly write a test. It would pass
even with a segfault since it could find the error
|
|
|
| |
Reverts nim-lang/Nim#23096
|
|
|
| |
fixes #22933
|
|
|
|
|
|
|
|
|
|
|
| |
#23032
---------
Co-authored-by: Nikolay Nikolov <nickysn@gmail.com>
Co-authored-by: Pylgos <43234674+Pylgos@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Jason Beetham <beefers331@gmail.com>
|
|
|
| |
ref https://github.com/ThomasTJdev/nim_websitecreator/pull/145
|
| |
|
|
|
|
|
|
|
| |
ref #19727
closes #22586
https://github.com/nim-lang/Nim/issues/22554 needs it to move on.
`newSeqUnsafe` can be introduced later.
|
|
|
| |
ref https://github.com/inim-repl/INim/pull/139
|
| |
|
|
|
| |
refs https://github.com/andreaferretti/neo/pull/53
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
instead (#22576)
* deprecate `std/threadpool`; use `malebolgia` instead
* Apply suggestions from code review
* Apply suggestions from code review
* change the URL of inim
|
|
|
|
|
| |
* use old typeinfo generation for hot code reloading
* at least test hello world compilation on orc
|
| |
|
| |
|
|
|
|
| |
strictdefs (#22458)
|
|
|
|
|
|
|
| |
defaults" (#22351)
Revert "fixes #22246; generate `__builtin_unreachable` hints for case defaults (#22350)"
This reverts commit b56df5c07f7dc9ac9d718ca47c10b0683a9b916f.
|
|
|
|
|
|
|
|
|
| |
* fixes #22246; generate `__builtin_unreachable` hints
* use elif
* indentation
* fixes holy enums in sim
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* clean up some test categories
* mention exact slice issue
* magics into system
* move trangechecks into overflow
* move tmemory to system
* try fix CI
* try fix CI
* final CI fix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* post expr blocks colon fix + correct grammar
fixes #21982
* fix dochelpers
* this is remarkably common
* use head for unchained
* fix atlas
* final grammar fix
|
|
|
|
|
|
|
|
|
| |
* Add drchaos, ssostrings, cowstrings to important packages
* Update important_packages.nim
---------
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
|
|
|
|
|
| |
* fix PreMain for hot code reloading with arc/orc
* fix regression? actually test nimhcr_basic
|
|
|
| |
fixes #21885
|