summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #22923; fixes `=dup` issues (#23182)ringabout2024-01-111-0/+10
| | | fixes #22923
* type refactoring: part 2 (#23059)Andreas Rumpf2023-12-131-9/+15
|
* Types: Refactorings; step 1 (#23055)Andreas Rumpf2023-12-121-8/+7
|
* IC: progress and refactorings (#22961)Andreas Rumpf2023-11-201-6/+6
|
* suppress incorrect var T destructor warnings for newFinalizer in stdlib (#22810)ringabout2023-10-111-1/+3
| | | | | | | | | | | | in `std/nre` ```nim proc initRegex(pattern: string, flags: int, study = true): Regex = new(result, destroyRegex) ``` gives incorrect warnings like ``` C:\Users\blue\Documents\Nim\lib\impure\nre.nim(252, 6) Error: A custom '=destroy' hook which takes a 'var T' parameter is deprecated; it should take a 'T' parameter [Deprecated ```
* fixes #22753; Nimsuggest segfault with invalid assignment to table (#22781)ringabout2023-10-021-1/+1
| | | | | | | | fixes #22753 ## Future work We should turn all the error nodes into nodes of a nkError kind, which could be a industrious task. But perhaps we can add a special treatment for error nodes to make the transition smooth.
* Instantiates generics in the module that uses it (#22513)Juan M Gómez2023-09-091-0/+2
| | | | | | | | | | Attempts to move the generic instantiation to the module that uses it. This should decrease re-compilation times as the source module where the generic lives doesnt need to be recompiled --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Add `hasDefaultValue` type trait (#22636)Amjad Ben Hedhili2023-09-041-0/+2
| | | Needed for #21842.
* relax the parameter of `ensureMove`; allow let statements (#22466)ringabout2023-08-121-2/+3
| | | | | * relax the parameter of `ensureMove`; allow let statements * fixes the test
* use strictdefs for compiler (#22365)ringabout2023-08-061-1/+4
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* Fix some jsgen bugs (#22330)konsumlamm2023-08-061-4/+0
| | | | | Fix `succ`, `pred` Fix `genRangeChck` for unsigned ints Fix typo in `dec`
* implement `ensureMove` (#22339)ringabout2023-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement `ensureMove` * use an additional flag * improve some logics * progress: fixes discard ensureMove * forbids nested expressions * improve error messages * checkpoint * fixes cursor * ADD MORE TESTS * fixes cursorinference again * tiny cleanup * improve error messages * fixes docs * implement comments add more tests * fixes js
* fixes #22301; fixes #22324; rejects branch initialization with a runtime ↵ringabout2023-07-251-2/+2
| | | | | | | | | | | discriminator with defaults (#22303) * fixes #22301; rejects branch initialization with a runtime discriminator with defaults * undefault nimPreviewRangeDefault * fixes tests * use oldCheckDefault
* extend the skipAddr for potential types for destructors (#22265)ringabout2023-07-181-2/+1
| | | extend the skipAddr for potential types
* fixes #22197; Distinct ref objects + destructor cause C++ codegen error (#22207)ringabout2023-07-021-0/+8
|
* privateAccess ignores non-objects (#21973)metagn2023-06-011-1/+3
| | | closes #21969
* improve `wasMoved` hooks; allow reset to use the overridden `wasMoved` hook ↵ringabout2023-05-121-0/+9
| | | | | | | (#21831) * improve `wasMoved` hooks * Because `wasMoved` is lifted
* bring #21802 back; fixes #21753 [backport] (#21815)ringabout2023-05-111-0/+4
| | | | | | | | | | | | | * bring #21802 back; fixes #21753 [backport] * adds tests and multiple fixes * add test cases * refactor and remove startId * fixes custom hooks and adds tests * handle tyUncheckedArray better
* refactoring in preparation for better, simpler name mangling that wor… ↵Andreas Rumpf2023-04-241-4/+4
| | | | | | | | | | | (#21667) * refactoring in preparation for better, simpler name mangling that works with IC flawlessly * use new disamb field * see if this makes tests green * make tests green again
* fixes #20155; repr range with distinct types is broken in ORC (#21682)ringabout2023-04-171-0/+5
| | | fixes #20155; repr range with distinct types is broken with ORC
* fixes #21377; fixes `@[]` and `{}` type inference as returns in generics ↵ringabout2023-03-061-1/+5
| | | | | | | | | | | | | (#21475) * fixes `@[]` type inference in generics * add issue links * fixes macros and iterators * refactor * add one more test
* fixes #21260; add check for illegal recursion for defaults (#21270)ringabout2023-01-181-2/+1
| | | | | * fixes #21260; add check for illegal recursion for defaults * fixes differently
* fixes object default fields bugs and add tests (#20839)ringabout2022-11-151-1/+2
| | | | | | | | | | | * fixes object default fields bugs and add tests * Update compiler/semmagic.nim * Update compiler/sem.nim * Update compiler/sem.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20836; fixes #20833; fixes `unsafeNew` (#20841)ringabout2022-11-141-1/+4
| | | | | * fixes #20836; fixes `unsafeNew` * fixes #20833
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-3/+5
| | | | | * fixes #20572 * added a test case
* fixes #19231; newFinalize doesn't work with ORC (#20291)ringabout2022-10-051-31/+28
| | | | | | | | | | | | | | | * fixes #19231; newFinalize doesn't work with ORC first make it pass tests * remove the tables dep creates a binding for finalized procs in order to handle the same symbols. It used to wrongly generat a new symbol id for the same symbol as the encountered one before * refactor and revert #14257 * de indentation * fixes tests; uses instantiated types
* add default field support for object in ARC/ORC (#20480)ringabout2022-10-041-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fresh start * add cpp target * add result support * add nimPreviewRangeDefault * reduce * use orc * refactor common parts * add tuple support * add testcase for tuple * cleanup; fixes nimsuggest tests * there is something wrong with cpp * remove * add support for seqs * fixes style * addd initial distinct support * remove links * typo * fixes tuple defaults * add rangedefault * add cpp support * fixes one more bugs * add more hasDefaults * fixes ordinal types * add testcase for #16744 * add testcase for #3608 * fixes docgen * small fix * recursive * fixes * cleanup and remove tuple support * fixes nimsuggest * fixes generics procs * refactor * increases timeout * refactor hasDefault * zero default; disable i386 * add tuples back * fixes bugs * fixes tuple * add more tests * fix one more bug regarding tuples * more tests and cleanup * remove messy distinct types which must be initialized by original types * add tests * fixes zero default * fixes grammar * fixes tests * fixes tests * fixes tests * fixes comments * fixes and add testcase * undo default values for results Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* fixes #19401; fixes #19402; rework Forward declaration and finalizer for ORC ↵ringabout2022-09-271-24/+48
| | | | | | | | | | | | | | | | | (#20295) * fixes #19401; fixes #19402; rework Forward declaration and finalizer for ORC * add more tests * give it a name * make more tests * fixes tests * hidden addr for cpp * move code to a function
* minor improvements to follow up recent PRs (#20342)metagn2022-09-141-1/+1
| | | | | | put mOpenArrayToSeq in compile-time evaluation whitelist (it was mNone before which was whitelisted), homogenize "ordinal type expected" errors, put overloadable enums in non-experimental manual
* Revert "fixes #20155; repr range with distinct types is broken with ORC" ↵Clay Sweetser2022-09-111-3/+0
| | | | | | | (#20334) Revert "fixes #20155; repr range with distinct types is broken with ORC (#20158)" This reverts commit 37b3f62eef16b0e7cb89e18f9ddc1fb96e17fb1b.
* fixes #20155; repr range with distinct types is broken with ORC (#20158)ringabout2022-09-111-0/+3
| | | | | * fixes #20155; repr range with distinct types is broken with ORC * skipRanges
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change `styleCheck` to ignore foreign packages * Symbols from foreign packages are now ignored. * Fixed `styleCheck` violations in `compiler` package. * Added symbol ownership to custom annotation pragmas. * Minor refactors to cleanup style check callsites. * Minor internal documentation of reasons why a symbol isn't checked. Style violations were fixed in the compiler after thet were exposed by the changes. The compiler wouldn't compile otherwise. Symbol ownership for custom pragma annotations is needed for checking the annotation's style. A NPE was raised otherwise. Fixes #10201 See also nim-lang/RFCs#456 * Fix a misunderstanding about excluding field style checks I had refactored the callsites of `styleCheckUse` to apply the DRY principle, but I misunderstood the field access handling in a template as a general case. This corrects it. * Fix some `styleCheck` violations in `compiler/evalffi` The violations were exposed in CI when the compiler was built with libffi. * Removed some uneeded transitionary code * Add changelog entry Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* apply changes from #18017 and some fixes (#19571)flywind2022-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/369 * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * merge * remove * fix bug Co-authored-by: Araq <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-161-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* test ord (#18909)flywind2021-09-281-4/+0
|
* Add optional recursive arg to distinctBase (v2) (#18659)Timothee Cour2021-08-091-2/+3
| | | | | | * Add optional recursive arg to distinctBase * Add docs and examples Co-authored-by: ALANVF <alan.invents@gmail.com>
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-0/+6
| | | | | | | | | | | * ORC: support custom =trace procs (WIP) * Update tests/arc/tcustomtrace.nim Co-authored-by: Clyybber <darkmine956@gmail.com> * =trace is now documented and seems to work * make test green Co-authored-by: Clyybber <darkmine956@gmail.com>
* make privateAccess work with generic types and generic instantiations; fix a ↵Timothee Cour2021-06-191-4/+6
| | | | | SIGSEGV (#18260) Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Revert localErrorNode param order changes (#17809)Clyybber2021-04-211-4/+4
| | | | | | | * Revert localErrorNode param order changes * Remove unused globalError overload * heh
* fix `hintMsgOrigin` regression + simplify msgs code (#17805)Timothee Cour2021-04-211-4/+4
|
* Introduce localErrorNode (#17785)Clyybber2021-04-191-8/+4
|
* privateAccess now works with ref | ptr (#17760)Timothee Cour2021-04-191-3/+3
|
* `import foo {.all.}` reboot (#17706)Timothee Cour2021-04-161-0/+5
|
* distinctBase now is identity instead of error for non distinct types (#16891)Timothee Cour2021-02-011-9/+4
|
* IC: next steps (#16729)Andreas Rumpf2021-01-231-3/+7
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
* IC: next steps (#16705)Andreas Rumpf2021-01-141-4/+4
| | | | | | | | | | | * code cleanups * refactorings for IC * more refactorings for IC * IC: attach the 'nil' type to its module * IC: refactorings and improvements * IC: progress * IC: more serialization fixes * IC: embarrassing omission * code cleanups
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-12/+12
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* fix #15707 (#15870)cooldome2020-11-091-8/+18
|
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-19/+19
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* Fix #15599 (#15601)Clyybber2020-10-161-1/+1
| | | | | * Fix #15599 * Add test