summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* fixes jsbigint64 regression; keeps convs to `Number` in danger mode (#23926)ringabout2024-08-112-1/+24
| | | fixes jsbigint64 regression
* fixes #23932; vmopsDanger for os.getCurrentDir errors (#23934)ringabout2024-08-112-4/+8
| | | | fixes #23932 ref https://github.com/jmgomez/NimForUE/issues/36
* don't treat template/macro/module as overloaded for opensym (#23939)metagn2024-08-113-3/+8
| | | | | | | | | | | | | | actually fixes #23865 following up #23873 In the handling of `nkIdent` in `semExpr`, the compiler looks for the closest symbol with the name and [checks the symbol kind](https://github.com/nim-lang/Nim/blob/6126a0bf46f4e29a368b8baefea69a2bcae54e93/compiler/semexprs.nim#L3171) to also consider the overloads if the symbol kind is overloadable. But it treats the normally overloadable template/macro/module sym kinds the same as non-overloadable symbols, just calling `semSym` on it. We need to mirror this behavior in `semOpenSym`; we treat the captured symchoice as a fresh identifier, so if the symbol we find is a template/macro/module, we use that symbol immediately as opposed to waiting for overloads.
* fixes #14522 #22085 #12700 #23132; no range check for uints (#23930)ringabout2024-08-115-9/+37
| | | | | | | | | | fixes #14522 fixes #22085 fixes #12700 fixes #23132 closes https://github.com/nim-lang/Nim/pull/22343 (succeeded by this PR) completes https://github.com/nim-lang/RFCs/issues/175 follow up https://github.com/nim-lang/Nim/pull/12688
* fixes #23914; jsondoc broken in devel (#23916)ringabout2024-08-113-3/+8
| | | | | follows up https://github.com/nim-lang/Nim/pull/23064 fixes #23914
* fixes #23907; Double destroy using proc type alias with a sink (#23909)ringabout2024-08-112-1/+25
| | | fixes #23907
* fixes #23902; Compiler infers sink in return type from auto (#23904)ringabout2024-08-112-3/+11
| | | fixes #23902
* special handlings for nimble packages to shorten function names (#23891)ringabout2024-08-112-29/+45
| | | | | | | | | | | | | | | | | | | If we need keep readabilities for functions' names, we might put the original names in the comments or in the identifiers like what currently has been done. The new nimble having been shipped since Nim 2.0.0 uses a directory ending with a full hash of a commit for cloned repos, the function names are burderen by this. This PR strips these from package paths and prepends "pkg" for readability. Before: raiseNilAccess__OOZOOZOnimbleZpkgs2Zthreading450O2O045288108d1dfa34d5ade5ce4d922af51909c83cebfZthreadingZsmartptrs_u4 After: raiseNilAccess__pkgZthreadingZsmartptrs_u4
* Fixed nimscript docs (#23938)Antonis Geralis2024-08-111-7/+7
|
* bump nimble to include the fix to `nimble dump` (#23918)Juan M Gómez2024-08-101-1/+1
|
* closes #6549; adds a test case (#23929)ringabout2024-08-091-1/+17
| | | closes #6549
* closes #21347; adds a test case (#23917)ringabout2024-08-041-0/+8
| | | closes #21347
* Add a document to toOpenArray proc (#23905)Tomohiro2024-08-012-0/+18
|
* fixes #13391; VM: Can't get address of object (#23903)ringabout2024-07-291-0/+2
| | | fixes #13391
* fixes JS semicolon omissions (#23896)ringabout2024-07-267-11/+11
|
* fixes #23894; succ/pred shouldn't raise OverflowDefect for unsigned integers ↵ringabout2024-07-262-1/+7
| | | | | | | (#23895) fixes #23894 keeps it consistent with `inc`
* implement genericsOpenSym for symchoices (#23873)metagn2024-07-256-25/+122
| | | | | | | | | | fixes #23865 The node flag `nfOpenSym` implemented in #23091 for sym nodes is now also implemented for open symchoices. This means the intended behavior is still achieved when multiple overloads are in scope to be captured, so the issue is fixed. The code for the flag is documented and moved into a helper proc and the experimental switch is now enabled for the compiler test suite.
* Overload resultion with generic variables an inheritance (#23870)Ryan McConnell2024-07-243-46/+117
| | | The test case diff is self explanatory
* bump nimble to 0.16.0 (#23883)Juan M Gómez2024-07-241-1/+1
|
* minor improvement on cgen (#23887)ringabout2024-07-241-4/+2
|
* improve mangling packages version names with checksums (#23888)ringabout2024-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | follow up https://github.com/nim-lang/Nim/pull/19821 dights cannot clash with letters 'Z' and 'O' For `threading-0.2.0-288108d1dfa34d5ade5ce4d922af51909c83cebf` Before: raiseNilAccess__OOZOOZOnimbleZpkgs50Zthreading4548O50O4845505656494856d49dfa5152d53ade53ce52d575050af5349574857c5651cebfZthreadingZsmartptrs_u4 After: raiseNilAccess__OOZOOZOnimbleZpkgs2Zthreading450O2O045288108d1dfa34d5ade5ce4d922af51909c83cebfZthreadingZsmartptrs_u4 <del> nimble or something might use `git rev-parse --short HEAD` to shorten the length of package version names ref https://github.com/nim-lang/nimble/pull/913 </del>
* fixes #19171; have `openArray` converted from `ptr UncheckedArray` be ↵Buldram2024-07-242-2/+28
| | | | | | mutable (#23882) Makes `toOpenArray(x: ptr UncheckedArray)` always return a `var openArray` regardless of if `x` is mutable.
* fixes #23867; fixes #23316; rework nimsuggest for ORC (#23879)ringabout2024-07-233-2/+48
| | | | | | | | fixes #23867 fixes #23316 follow up https://github.com/nim-lang/Nim/pull/22805; fixes https://github.com/nim-lang/Nim/issues/22794 in a different method
* turn some sym flag aliases into enums (#23884)ringabout2024-07-231-18/+13
|
* doc,test(times): followup #23861 (#23881)lit2024-07-232-4/+17
| | | followup #23861
* Allocator: Always place free cells into the active chunk and add ↵SirOlaf2024-07-221-21/+96
| | | | | | | | | | | | | | documentation (#23871) Lets single threaded applications benefit from tracking foreign cells as well. After this, `SmallChunk` technically doesn't need to act as a linked list anymore I think, gotta investigate that more though. The likelihood of overflowing `chunk.free` also rises, so to work around that it might make sense to check `foreignCells` instead of adjusting free space or replace free with a counter for the local capacity. For Nim compile I can observe a ~10mb reduction, and smaller ones for other projects.
* fixes #23838: Compilation by MinGW for cpu=i386 with time_t bug (#23876)Ward2024-07-221-1/+1
| | | | Change Time type in std/time_t to `distinct clong` instead of `distinct int32`
* fixes #23869; sink generic typeclass (#23874)Ryan McConnell2024-07-222-2/+28
| | | | | | | Still have to look this over some. We'll see. I put sink in this branch simply because I saw `tyVar` there and for no other reason. In any case the problem appears to be coming from `liftParamType` as it removes the `sink` type from the formals. #23869
* Fix out-of-bounds slicing in std/varints (#23868)Buldram2024-07-222-7/+7
| | | | | | Corrects a slicing mistake in the `std/varints` implementation which caused it to fail when writing large numbers into buffers smaller than 10..13-bytes, now 9-byte buffers are sufficient as the documentation states.
* remove unused field in ConfigRef (#23875)ringabout2024-07-221-1/+0
| | | follow up https://github.com/nim-lang/Nim/pull/14763
* Merge tyUncheckedArray with tySeq in typeRel (#23866)SirOlaf2024-07-202-10/+6
| | | | | | Ref https://github.com/nim-lang/Nim/issues/23836#issuecomment-2233957324 Their types are basically equivalent so they should behave the same way for type relations.
* bypass constraints for tyFromExpr in generic bodies (#23863)metagn2024-07-202-4/+27
| | | | | | | | | | | | | | | | | | | | | | | fixes #19819, fixes #23339 Since #22029 `tyFromExpr` does not match anything in overloading, so generic bodies can know which call expressions to delay until the type can be evaluated. However generic type invocations also run overloading to check for generic constraints even in generic bodies. To prevent them from failing early from the overload not matching, pretend that `tyFromExpr` matches. This mirrors the behavior of the compiler in more basic cases like: ```nim type Foo[T: int] = object x: T Bar[T] = object y: Foo[T] ``` Unfortunately this case doesn't respect the constraint (#21181, some other bugs) but `tyFromExpr` should easily use the same principle when it does.
* fixes nim secret not flushing stdout (#23862)ringabout2024-07-201-0/+1
| | | | | | | | | | | | | | | related to https://github.com/nim-lang/Nim/pull/19584 On Vscode wsl2 Before: ![image](https://github.com/user-attachments/assets/4bb4f92d-757d-4edf-9dcf-17fcb98f0b60) After ![image](https://github.com/user-attachments/assets/289a113e-c27c-4b76-9d13-725ca28f2828)
* Allocator: Track number of foreign cells a small chunk has access to (#23856)SirOlaf2024-07-201-29/+46
| | | | | | | | | Ref: https://github.com/nim-lang/Nim/issues/23788 There was a small leak in the above issue even after fixing the segfault. The sizes of `free` and `acc` were changed to 32bit because adding the `foreignCells` field will drastically increase the memory usage for programs that hold onto memory for a long time if they stay as 64bit.
* fix generics treating symchoice symbols as uninstantiated (#23860)metagn2024-07-192-1/+96
| | | | | | | | | | | | | fixes #23853 Since #22610 generics turns the `Name` in the `GT.Name` expression in the test code into a sym choice. The problem is when the compiler tries to instantiate `GT.Name` it also instantiates the sym choice symbols. `Name` has type `template (E: type ExtensionField)` which contains the unresolved generic type `ExtensionField`, which the compiler mistakes as an uninstantiated node, when it's just part of the type of the template. The compilation of the node itself and hence overloading will handle the instantiation of the proc, so we avoid instantiating it in `semtypinst`, similar to how the first nodes of call nodes aren't instantiated.
* Add '.' (period, dot, ..) to `FormatLiterals` so that `ss.fff` can work. ↵c-blake2024-07-191-1/+1
| | | | | | | | | | | | | (#23861) Honestly, to me the entire design of a (highly!) restricted set of `FormatLiterals` characters seems antithetical to the very idea of a format string template. Fixing that is a much larger change, though. So, this PR just adds `'.'` so that the standard (both input & output!) notation for decimal numbers in Nim can be used for the seconds part of a time format in `lib/pure/times.format(.., f)`. It should only make legal what was illegal and should be harmless since `'.'` is not used in any special way otherwise.
* fixes #23858; 2.2.0 rc1 regression with cdecl functions (#23859)ringabout2024-07-184-4/+17
| | | | | | fixes #23858 We should not assign fields to fields for returns of function calls because calls might have side effects.
* doc: times.nim: DD -> dd (#23857)lit2024-07-181-2/+2
| | | `YYYY-MM-dd` was mistaken as `YYYY-MM-DD`.
* Set type of object constructor during annotateType (#23852)SirOlaf2024-07-172-0/+24
| | | | | | Fix https://github.com/nim-lang/Nim/issues/23547 Tested locally with the included test, the test from constantine and the original issue.
* 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
* fixes #23848; The comand `nim gendepend` defaults to ORC (#23851)ringabout2024-07-171-1/+2
| | | fixes #23848
* Fixes #23846; prepend nimArgs to args (#23847)EuklidAlexandria2024-07-171-2/+3
| | | | Fixes #23846. Probably, nimArgs should be prepended in other places (e.g. `buildDocSamples`).
* fixes #23844; Nim devel nightly i386 build failing (#23849)ringabout2024-07-171-1/+1
| | | | | | | | | | | | fixes #23844 follow up https://github.com/nim-lang/Nim/pull/23834 ```nim type Timespec* {.importc: "struct timespec", header: "<time.h>", final, pure.} = object ## struct timespec tv_sec*: Time ## Seconds. tv_nsec*: clong ## Nanoseconds. ```
* Add warnings about exec usage. (#23820)Antonis Geralis2024-07-171-2/+9
| | | | | | | | | | | Related to https://github.com/nim-lang/Nim/issues/23819 and also found in discord https://discord.com/channels/371759389889003530/371759389889003532/1260845467147829372 Since nothing can be done, besides deprecating the function, a warning is a better option. --------- Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* fixes #23837; cursor now processes distinct types with a destructor (#23845)ringabout2024-07-172-2/+62
| | | fixes #23837
* make routine implicitly gensym when other gensym symbol exists again (#23842)metagn2024-07-164-9/+26
| | | | | | | | | | | | | fixes #23813, partially reverts #23392 Before #23392, if a `gensym` symbol was defined before a proc with the same name in a template even with an `inject` annotation, the proc would be `gensym`. After #23392 the proc was instead changed to be `inject` as long as no `gensym` annotation was given. Now, to keep compatibility with the old behavior, the behavior is changed back to infer the proc as `gensym` when no `inject` annotation is given, however an explicit `inject` annotation will still inject the proc. This is also documented in the manual as the old behavior was undocumented and the new behavior is slightly different.
* fixes semi-regression; discard check now skips `nkHiddenSubConv` (#23840)ringabout2024-07-162-1/+10
| | | | | follow up https://github.com/nim-lang/Nim/pull/23681 ref https://forum.nim-lang.org/t/11987
* fixes regression; block can have arbitrary exit points; too hard for a ↵ringabout2024-07-162-5/+18
| | | | | | | | simple analysis (#23839) follow up https://github.com/nim-lang/Nim/pull/23681 ref https://forum.nim-lang.org/t/11987 ref https://github.com/nim-lang/Nim/issues/23836#issuecomment-2227267251
* [minor] fixes wrong error messages (#23841)ringabout2024-07-161-1/+1
|
* Silence `hint:performance` message when using very basic http client (#23832)c-blake2024-07-151-1/+2
| | | | | | | | | | | | code such as: ```Nim import std/httpclient # nim c --hint:performance:on echo newHttpClient(proxy=nil, headers=newHttpHeaders({"Accept": "*/*"})).getContent("x") ``` (Fix was suggested by @ringabout in a private channel.) Seems useful since `httpclient` is so basic/probably pervasive with many hundreds of `import`s across the NimbleVerse.