summary refs log tree commit diff stats
path: root/testament
Commit message (Collapse)AuthorAgeFilesLines
* workaround for `strunicode` package no longer needed (#24132)Miran2024-09-181-1/+1
|
* make `var`/pointer types not match if base type has to be converted (#24130)metagn2024-09-181-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* streams: implement readStr for VM, document VM limitations (#24058)metagn2024-09-041-1/+1
| | | | | | | | | | | 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.
* handle explicit generic routine instantiations in sigmatch (#24010)metagn2024-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* use the official URL of neo (#24019)ringabout2024-08-281-1/+1
| | | ref https://github.com/andreaferretti/neo/pull/55
* Try to revert "disable presto" (#23987)ringabout2024-08-201-1/+1
| | | | | | | 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
* adds a ubuntu 24.04 matrix with gcc 14 for tests (#23673)ringabout2024-08-201-0/+5
| | | ref https://forum.nim-lang.org/t/11587
* disable presto (#23958)ringabout2024-08-151-1/+1
|
* Add constantine to important_packages.nim (#23801)Mamy Ratsimbazafy2024-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ![image](https://github.com/nim-lang/Nim/assets/22738317/21c875d7-512f-4c21-8547-d12534e93a58). 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
* disable dnsclient because it is fragile (#23728)ringabout2024-06-181-1/+1
| | | | | | | | | | | | | | | ``` 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 ```
* remove pkg "pylib" (#23691)ringabout2024-06-071-1/+0
| | | https://github.com/Yardanico/nimpylib is 404 now
* [backport] test more packages (#23671)Miran2024-06-031-0/+13
| | | | These packages are some of the dependencies of Nimbus with shorter testing times.
* remove winim from important packages; since CI doesn't check windows ↵ringabout2024-05-301-1/+1
| | | | | platform (#23661) Cannot compile on Linux reliably
* fixes testament matrix doesn't work with other backends which left many JS ↵ringabout2024-05-141-3/+24
| | | | | | tests untested (#23592) Targets are not changes, which means the C binary is actually tested for JS backend
* bring `telebot` back (#23578)ringabout2024-05-071-1/+1
| | | | | Reverts nim-lang/Nim#23566 ref https://github.com/ba0f3/telebot.nim/commit/afe4ad877ec015091f5b6fde32ecb2502fe59a3f
* fixes CI failure (#23566)ringabout2024-05-041-1/+1
|
* remove HEAD arraymancer dependency requirement in package CI (#23509)metagn2024-04-171-3/+3
| | | | | 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
* stop gensym identifiers hijacking routine decl names in templates (#23392)metagn2024-04-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Revert "disable measuremancer" (#23353)ringabout2024-02-261-1/+1
| | | | | | Reverts nim-lang/Nim#23352 ref https://github.com/SciNim/Measuremancer/commit/e2e994b21c162d5c382f04383893f2abb12af51f
* disable measuremancer (#23352)ringabout2024-02-261-1/+1
| | | ref https://github.com/SciNim/Measuremancer/issues/17
* fixes broken doc links (#23255)ringabout2024-01-251-1/+1
| | | | | 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
* CI entry may be reset to default (#23127)Ryan McConnell2023-12-251-1/+1
|
* retain postfix node in type section typed AST, with docgen fix (#23101)metagn2023-12-231-1/+2
| | | | | | 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
* Don't crash for invalid toplevel parseStmt/Expr calls (#23089)Jake Leahy2023-12-191-4/+9
| | | | | | | | | | | | | | | 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
* Revert "retain postfix node in type section typed AST" (#23098)metagn2023-12-191-2/+1
| | | Reverts nim-lang/Nim#23096
* retain postfix node in type section typed AST (#23096)metagn2023-12-181-1/+2
| | | fixes #22933
* Param match relax (#23033)Ryan McConnell2023-12-151-1/+1
| | | | | | | | | | | #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>
* enable nimwc testing (#22960)ringabout2023-11-191-1/+1
| | | ref https://github.com/ThomasTJdev/nim_websitecreator/pull/145
* arraymancer switches to the offical URL (#22782)ringabout2023-10-031-1/+1
|
* deprecates `newSeqUninitialized` replaced by `newSeqUninit` (#22739)ringabout2023-09-291-2/+2
| | | | | | | ref #19727 closes #22586 https://github.com/nim-lang/Nim/issues/22554 needs it to move on. `newSeqUnsafe` can be introduced later.
* iNim switch to the official URL (#22762)ringabout2023-09-271-1/+1
| | | ref https://github.com/inim-repl/INim/pull/139
* fixes stint CI (#22756)ringabout2023-09-261-1/+1
|
* switch back to main neo in CI (#22660)metagn2023-09-061-2/+1
| | | refs https://github.com/andreaferretti/neo/pull/53
* add union to packages (#22658)ringabout2023-09-061-0/+1
|
* fixes yaml tests (#22595)ringabout2023-08-311-1/+1
|
* deprecate `std/threadpool`; use `malebolgia`, `weave`, `nim-taskpool` ↵ringabout2023-08-291-1/+1
| | | | | | | | | | | 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 (#22518)metagn2023-08-201-2/+5
| | | | | * use old typeinfo generation for hot code reloading * at least test hello world compilation on orc
* update test command of important packages (#22485)ringabout2023-08-151-6/+6
|
* Markdown code blocks migration part 8 (#22478)Andrey Makarov2023-08-151-7/+6
|
* replace `doAssert false` with `raiseAssert` in lib, which works better with ↵ringabout2023-08-111-1/+1
| | | | strictdefs (#22458)
* Revert "fixes #22246; generate `__builtin_unreachable` hints for case ↵ringabout2023-07-311-1/+1
| | | | | | | defaults" (#22351) Revert "fixes #22246; generate `__builtin_unreachable` hints for case defaults (#22350)" This reverts commit b56df5c07f7dc9ac9d718ca47c10b0683a9b916f.
* fixes #22246; generate `__builtin_unreachable` hints for case defaults (#22350)ringabout2023-07-311-1/+1
| | | | | | | | | * fixes #22246; generate `__builtin_unreachable` hints * use elif * indentation * fixes holy enums in sim
* switch to the official chronicles URL (#22033)ringabout2023-06-071-1/+1
|
* some test cleanups & category reorganization (#22010)metagn2023-06-062-3/+3
| | | | | | | | | | | | | | | | | * 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 (#21983)metagn2023-06-062-2/+3
| | | | | | | | | | | | | | | * 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 (#21824)Antonis Geralis2023-06-031-0/+3
| | | | | | | | | * Add drchaos, ssostrings, cowstrings to important packages * Update important_packages.nim --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* switch to official manu URL (#21986)ringabout2023-06-031-1/+1
|
* lift the `=dup` hook (#21903)ringabout2023-06-021-1/+1
| | | | | | * fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
* hot code reloading: fix regression? and PreMain with arc/orc (#21940)metagn2023-05-301-2/+5
| | | | | * fix PreMain for hot code reloading with arc/orc * fix regression? actually test nimhcr_basic
* fix & add test for basic hot code reloading case (#21915)metagn2023-05-261-0/+1
| | | fixes #21885