Commit Graph

9163 Commits

Author SHA1 Message Date
Jordan Gillard
a9f1e2dfcd 🚀 Enhancing CellSeq for Better Readability and Maintainability (#21797)
Refactor and improve readability of CellSeq in system directory

* Use half-open range in the contains procedure for better readability and to avoid potential off-by-one errors
* Extract resizing logic from add procedure into a separate resize procedure for better code readability and separation of concerns

(cherry picked from commit 71f2e1a502)
2023-09-11 10:54:35 +02:00
ringabout
7a747fe320 fixes #21792; enable checks for sum, prod, cumsummed and cumsum (#21793)
* enable checks for sum, prod, cumsummed  and cumsum

* fixes #21792

* add test cases

(cherry picked from commit 07233ceca0)
2023-09-11 10:54:34 +02:00
metagn
fa3639ba33 line info for strformat + fix issue with typed templates (#21761)
* line info in strformat

* also fix #20381

(cherry picked from commit e5d0907a42)
2023-09-11 10:54:34 +02:00
metagn
7b99712bcf fix iterator equality + add test for proc equality + fix sameType (#21707)
* fix iterator equality + add test also for procs

fixes #21706

* all targets

* and isNil and repr

* separate overloads, fix sameType

* more restricted sameType?

* merge overloads again??

* remove sametype change for now

* fix sameType anyway (CI failure was not related)

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
(cherry picked from commit 380dafcc32)
2023-09-11 10:54:34 +02:00
ringabout
5d39a8283c fixes #20516; system.create doesn't work with bitfield objects (#20518)
* Revert "fixes #19000 (#19032)"

This reverts commit 2bda4a30a6.

* fixes #20516; add testcase

(cherry picked from commit 5e4dd571d4)
2023-08-11 12:42:20 +02:00
narimiran
80ece5921f use unsafeAddr 2023-08-11 12:35:56 +02:00
ringabout
b901e94936 fixes #22387; Undefined behavior when with hash(...) (#22404)
* fixes #22387; Undefined behavior when with hash(...)

* fixes vm

* fixes nimscript

(cherry picked from commit 47d06d3d4c)
2023-08-11 10:53:24 +02:00
norrath-hero-cn
0cb84726d0 fixes AddressSanitizer: global-buffer-overflow in getAppFilename on windows 10 (#22380)
fixes AddressSanitizer: global-buffer-overflow

(cherry picked from commit 73a29d72e3)
2023-08-11 10:53:01 +02:00
narimiran
d1b5df06b0 bump NimVersion to 1.6.15 2023-07-03 11:57:42 +02:00
narimiran
71ba2e7f3c bump NimVersion to 1.6.14 2023-06-26 15:17:14 +02:00
ringabout
04d0716f37 fix #9423 followup #17594: distinct generics now work in VM (#21816)
* fix #9423 distinct generics now work in vm

* fixes cpp tests

---------

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
(cherry picked from commit deaf684375)
2023-06-19 13:12:01 +02:00
Etan Kissling
55776451b4 avoid AnyEnumConv warning in genEnumCaseStmt (#22061)
When parsing enums from strings using `genEnumCaseStmt`, `AnyEnumConv`
warnings are generated due to conversion from integer value. It seems
possible meanwhile to refer to the actual `enum` value by symbol instead
of being required to do the conversion from `ord`, even when the `enum`
is defined in a `block`.

(cherry picked from commit 8bba04078c)
2023-06-15 14:45:58 +02:00
ringabout
2410580d59 fixes #21847; let parseFloat behave like strtod (#21854)
(cherry picked from commit f22e5067c5)
2023-06-15 13:40:44 +02:00
litlighilit
2b6797dc42 Update browsers.nim, fix openDefaultBrowser()'s bug for v1 (#22067)
For details see [the PR for v2](https://github.com/nim-lang/Nim/pull/22052), but this one is specific to v1
2023-06-11 06:56:12 +02:00
Andreas Rumpf
653865559a fixes #21734; backport (#21957)
(cherry picked from commit 244565397d)
2023-05-30 09:38:13 +02:00
Andreas Rumpf
285a18d683 make ORC threadlocal, take two (#21818)
* ORC: make rootsThreshold thread local [backport]

* fixes the regression

(cherry picked from commit f3a4cc584e)
2023-05-24 11:20:00 +02:00
Andreas Rumpf
1d7ccc0ca6 Windows: use __declspec(thread) TLS implementation, it is MUCH faster… (#21810)
* Windows: use __declspec(thread) TLS implementation, it is MUCH faster than _Thread_local [backport]

* Update lib/nimbase.h

* better fix

(cherry picked from commit ec3bca8fab)
2023-05-24 11:18:58 +02:00
metagn
037f87d904 top-down type inference, implements rfc 149 (#20091)
* micro implementation of rfc 149

refs https://github.com/nim-lang/RFCs/issues/149

* number/array/seq literals, more statements

* try fix number literal alias issue

* renew expectedType with if/case/try branch types

* fix (nerf) index type handling and float typed int

* use typeAllowed

* tweaks + const test (tested locally) [skip ci]

* fill out more of the checklist

* more literals, change @ order, type conversions

Not copying the full call tree before the typedesc call check
in `semIndirectOp` is also a small performance improvement.

* disable self-conversion warning

* revert type conversions (maybe separate op later)

* deal with CI for now (seems unrelated), try enums

* workaround CI different way

* proper fix

* again

* see sizes

* lol

* overload selection, simplify int literal -> float

* range, new @ solution, try use fitNode for nil

* use new magic

* try fix ranges, new magic, deal with #20193

* add documentation, support templates

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit 0014b9c48e)
2023-05-11 15:12:38 +02:00
Andreas Rumpf
c88f58948a fixes #21780 [backport:1.6] (#21785)
* fixes #21780 [backport:1.6]

* complete patch

(cherry picked from commit 79ac242c72)
2023-05-05 14:59:49 +02:00
Jake Leahy
a456c8797f Allow futureLogging in release builds (#21448)
* Add test case

* Fixes 21447: Keeps stackTrace around when using futureLogging

* Remove extra whitespace

(cherry picked from commit d4d28f2ffe)
2023-05-03 18:32:48 +02:00
ringabout
6f05abf21c fixes #21638; fromJson should support empty objects (#21641)
* fixes #21638; `fromJson` should supports empty objects

* complete the logic

(cherry picked from commit 5e016e4466)
2023-04-26 15:12:03 +02:00
Jake Leahy
a676c3aeca multisync now allows tuples in return type (#21074)
* Add test case

* Use .toStrLit() on param node first

This means that more complex types are fully rendered

(cherry picked from commit c7493bbdd0)
2023-04-26 10:53:35 +02:00
Emery Hemingway
4234bbe7bd macros.customPragmaNode: walk brackets on brackets (#21040)
(cherry picked from commit 696def2bf7)
2023-04-26 09:31:33 +02:00
Ico Doornekamp
7e7b35b5c0 channel send() condition variable lock ordering (#20879)
(cherry picked from commit 79b25a911b)
2023-04-26 09:31:32 +02:00
Bung
b2b226bb28 fix #16264 low(Time) OverflowDefect (#20552)
fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect

(cherry picked from commit 534c97edc5)
2023-04-25 16:27:31 +02:00
Antonis Geralis
b47d12fe0a atomicInc global alloc counters (#20571)
(cherry picked from commit ed26156c99)
2023-04-25 15:34:47 +02:00
Peter Munch-Ellingsen
2dff0c1a61 Fix issue with fields trying to use wrong name (#12655)
* Fix issue with fields trying to use wrong name

* Fix similar issue in winlean

* Revert accidental csize change

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
(cherry picked from commit 805186809c)
2023-04-25 15:34:46 +02:00
ringabout
3e93e00391 remove var for ref parameters in std/tables (#20175)
remove `var` from ref parameters; make it consistent

(cherry picked from commit ea44c5cfed)
2023-04-24 22:08:59 +02:00
Juan M Gómez
22d043997c Fixes Compilation error with --app:lib (#19965)
Fixes Compilation error with --app:lib  when a module tries to pull os.paramStr on posix by throwing a runtime exception instead.
More details here: #19964

(cherry picked from commit a90763ebd7)
2023-04-24 22:02:32 +02:00
Tanguy
67b94a96f7 Better range error messages (#19867)
* Better range error messages

* Revert to old behavior for arrays

* Small corrections

(cherry picked from commit d33e112766)
2023-04-24 21:58:22 +02:00
ehmry
840b34684d macros: make hasCustomPragma more permissive (#19747)
Make hasCustomPragma return false rather than fail for invalid
parameters.

(cherry picked from commit 82680a12a7)
2023-04-24 17:34:48 +02:00
Nan Xiao
6602961637 No need to export pos from OptParser (#19688)
Co-authored-by: flywind <xzsflywind@gmail.com>
(cherry picked from commit 065f568470)
2023-04-24 17:34:37 +02:00
flywind
31f7b17dd0 remove unnecessary framePtr code (#19645)
(cherry picked from commit afbcba909b)
2023-04-24 17:33:59 +02:00
Regis Caillaud
a33603925d Clonkk fix2 11923 (#19451)
* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas

(cherry picked from commit 486cb09ec2)
2023-04-24 17:33:24 +02:00
Regis Caillaud
70478d34e3 Fix #11923 (#19427)
* Apply commit 5da931fe81 that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma

(cherry picked from commit 1563cb2f6e)
2023-04-24 17:31:56 +02:00
flywind
5cd2665c29 Atomic inc/dec should use ATOMIC_SEQ_CST (#19212)
(cherry picked from commit 0992854941)
2023-04-24 17:28:53 +02:00
Don-Duong Quach
4728e9d433 fix for #19020, credit to @ElegantBeef (#19021)
(cherry picked from commit f2f15e9726)
2023-04-24 17:26:09 +02:00
Andreas Rumpf
26ed32e67e fixes #19000 (#19032)
* fixes #19000

* progress

(cherry picked from commit 2bda4a30a6)
2023-04-24 17:22:44 +02:00
Tomasz Kramkowski
01dc38a05c Fix nimIdentNormalize, fixes #19067 (#19068)
* Make nimIdentNormalize return "" when passed ""; fixes #19067

Fixes #19067

* Add tests for nimIdentNormalize

(cherry picked from commit ee703c5db4)
2023-04-24 17:22:22 +02:00
narimiran
a5a2c57e88 correctly do the JSON backport 2023-04-24 09:43:55 +02:00
Yardanico
4071b3fad8 Fix json.to for float fields that are not present (#21695)
(cherry picked from commit 418e54452b)
2023-04-21 13:10:49 +02:00
Bung
064ed4846d fix #20997 (#21165)
* fix #20997

* use ptr UncheckedArray[uint8] instead

(cherry picked from commit 0d6b994bee)
2023-04-19 12:18:41 +02:00
Bung
6007b12b30 fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 … (#21010)
* fix #20997 calling system.card[T](x: set[T]) with T of int8 or uint8 uses mismatched C array sizes
* fullfil set variant

(cherry picked from commit 0b319fee3d)
2023-04-19 12:18:29 +02:00
Etan Kissling
eecd8373ed terminal size env-vars have precendence in POSIX (#21643)
In POSIX Base Definitions Section 8.1 Environment Variable Definition,
it is explained that the `COLUMNS` and `LINES` environment variables,
if present, take precedence over any other implementation-defined method
to determine the terminal size. This is useful, for example, to capture
output programmatically in simulations for various terminal sizes.

(cherry picked from commit 75205fee93)
2023-04-11 10:05:04 +02:00
ringabout
65a7496e51 fix #20972 fixes invalid and UB codegen case object transitions for both refc and ORC [backport] (#21611)
fix #20972 fixes invalid and UB codegen case object transitions for refc and ORC

(cherry picked from commit 3575f2bf9c)
2023-04-05 08:09:27 +02:00
tersec
a8c6e36323 don't access void* out of alignment in refc GC to avoid UB (#21560)
(cherry picked from commit e8a70ff179)
2023-03-27 14:50:49 +02:00
narimiran
b6ed118f0c bump NimVersion to 1.6.13 2023-03-21 14:35:18 +01:00
narimiran
1aa9273640 bump NimVersion to 1.6.12 2023-03-09 20:19:29 +01:00
Ivan Yonchovski
d723d5ff72 Fix nimble build for 1.6 (#21490) 2023-03-08 14:01:08 +01:00
Matt Haggard
5c36f24da2 Backport #20466 - macOS use SecRandomCopyBytes instead of getentropy (#21389)
* On macOS use SecRandomCopyBytes instead of getentropy (which is only available on macOS 10.12+)

* Change passL to passl

---------

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2023-03-02 14:26:04 -05:00