summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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
* fixes #14616 [backport:1.2] (#15109)Andreas Rumpf2020-07-291-0/+4
|
* fixes #15044 [backport:1.2]Andreas Rumpf2020-07-231-3/+5
|
* 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)Andreas Rumpf2020-07-201-1/+4
|
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-3/+0
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* fix #14243 (#14257)cooldome2020-05-071-5/+9
| | | | | * fix #14243 Co-authored-by: cooldome <ariabushenko@bk.ru>
* drnim: tiny progress (#13882)Andreas Rumpf2020-04-151-8/+22
| | | | | | | | | | | * drnim: tiny progress * refactoring complete * drnim: prove .ensures annotations * Moved code around to avoid code duplication * drnim: first implementation of the 'old' property * drnim: be precise about the assignment statement * first implementation of --assumeUnique * progress on forall/exists handling
* Turn some of the errors back into warningsZahary Karadjov2020-04-011-1/+16
|
* DrNim (Nim compiler with Z3 integration) (#13743)Andreas Rumpf2020-03-311-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | * code cleanups and feature additions * added basic test and koch/CI integration * make it build on Unix * DrNim: now buildable on Unix, only takes 10 minutes, enjoy * added basic documentation for DrNim which can also be seen as the RFC we're following * drnim: change the build setup so that drnim.exe ends up in bin/ * makes simple floating point ranges work * added basic float range check * drnim: teach Z3 about Nim's range types plus code refactoring * drnim: make unsigned numbers work * added and fixed index checking under setLen * first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking * drnim: .requires checking implemented * drnim: implemented .ensures properly * more impressive test involving min() * drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures * testament: support for 'pattern <directory> * koch: uses new <directory> feature of testament * drnim: added tiny musings about 'old' * Make testament work with old SSL versions * koch: add support for 'koch drnim -d:release' * drnim: preparations for the param.old notation
* rename `lenTuple` and `lenVarargs` (#13639)Miran2020-03-121-1/+1
| | | | | | | | | | | * rename 'lenTuple' to 'tupleLen' Rationale: `lenTuple` is a tuple consisting of lengths (e.g. `(1, 5, 0)`), `tupleLen` is a length of a tuple (e.g. `tupleLen((1, 5, 0) == 3`) * rename 'lenVarargs' to 'varargsLen' The same rationale as a previous commit. Consistency.
* Remove dead magics (#13551)Arne Döring2020-03-031-3/+1
|
* fix incorrect lenTuple implementation (#13423)Timothee Cour2020-02-191-0/+4
|
* fix `is` with generic types; fix `genericHead(Foo[T])` (#13303)Timothee Cour2020-02-091-10/+16
| | | | | * fix #9855, fix #9855, fix genericHead * render TTypeKind via toHumanStr
* miscellaneous bug fixes (part 3) (#13304)Timothee Cour2020-02-071-1/+1
| | | | | | | | | | * fix deprecation; fix indentation * git clone: use -q * fix Warning: pragma before generic parameter list is deprecated; fix typo * bugfix: sysTypeFromName("float64") was never cached
* fix #13349 regression: isNamedTuple now works with generic tuples (#13350)Timothee Cour2020-02-071-0/+1
|
* fixes #13095 (#13181)cooldome2020-01-171-0/+3
| | | | | | * fixes #13095 * fix typo
* fixes #13112 (#13127)Andreas Rumpf2020-01-131-2/+9
| | | | | | * improve line error information * fixes #13112
* more arc features (#13098)Andreas Rumpf2020-01-101-0/+31
| | | | | * config update * ARC now supports 'repr' and 'new' with finalizers is supported
* distinctBase type trait for distinct types (#13031)cooldome2020-01-081-0/+16
|
* fixes #12804 (#12809)cooldome2019-12-051-2/+2
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-37/+36
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* error message: Nim calls it 'proc'Andreas Rumpf2019-11-071-1/+1
|