summary refs log tree commit diff stats
path: root/compiler/parampatterns.nim
Commit message (Collapse)AuthorAgeFilesLines
* allow conversions between `var` types of range types and base types (#24037)metagn2024-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | refs #24032, split from #24036 Conversion from variables of range types or base types of range types to the other are now considered mutable for `var` params, similar to how distinct types are mutable when converted to their base type or vice versa. There are 2 main differences: 1. Conversions from base types to range types need to emit `nkChckRange`, which is not generated for things like tuple/object fields. 2. Range types can still correspond to different types in the backend when nested in other types, such as `set[range[3..5]]` vs `set[range[0..5]]`. Since the convertibility check for `var` params and a check whether to emit a no-op for `nkConv` (and now also `nkChckRange`) so that the output is still addressable both use `sameType`, we accomplish this by adding a new flag to `sameType` that ignores range types, but only when they're not nested in other types. The implementation for this might be flawed, I didn't include children of some metatypes as "nested in other types", but stuff like `tyGenericInst` params are respected.
* fixes #19171; have `openArray` converted from `ptr UncheckedArray` be ↵Buldram2024-07-241-2/+9
| | | | | | mutable (#23882) Makes `toOpenArray(x: ptr UncheckedArray)` always return a `var openArray` regardless of if `x` is mutable.
* prepare for the enforcement of `std` prefix (#22873)ringabout2023-10-291-1/+3
| | | follow up https://github.com/nim-lang/Nim/pull/22851
* use strictdefs for compiler (#22365)ringabout2023-08-061-0/+1
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* new move analyser2 (#20471)Andreas Rumpf2022-10-011-2/+2
| | | | | | | | * produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* store full definition AST for consts, fix noRewrite (#20115)metagn2022-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * continue #9582 for consts, close #9331, fix #20114 also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc * changelog correctly * fix jsgen * update tgetimpl * fix sighashes * fix #19766, add comment about postfix * fix noRewrite LOL refs #16620 * fix changelog * fix destructors
* apply changes from #18017 and some fixes (#19571)flywind2022-03-011-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fix term rewriting with sideeffect (#19410)flywind2022-01-191-2/+5
| | | | | | | | | * fix term rewriting with sideeffect fix #6217 * add tests * Update tests/template/template_various.nim
* reuse existing toHumanStr (#15674)Timothee Cour2020-10-211-1/+1
|
* implements https://github.com/nim-lang/RFCs/issues/257 (#15466)Andreas Rumpf2020-10-021-0/+2
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-2/+2
|
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-3/+3
| | | | | | | | | | | * 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
* fixes #14557 (#14607)Andreas Rumpf2020-06-081-1/+1
|
* fixes #14498 [backport:1.2] (#14503)Andreas Rumpf2020-05-301-3/+9
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-24/+24
| | | | | | | | | | | | | | | | | | * 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
* fixes #12224 (#12225)cooldome2019-09-211-3/+5
| | | | | | * fixes #12224 * improve test
* sink as lvalueAndrii Riabushenko2019-09-021-3/+3
|
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* fixes #10942. Lent T bug (#10946)cooldome2019-04-031-5/+12
| | | | | | | | * fixes #10942 * add test * bug build
* fixes #7524Araq2019-01-141-8/+7
|
* Allow taking address of skForVar variables (#8632)LemonBoy2018-08-141-1/+1
| | | Fixes #8630
* guards.nim does compileAndreas Rumpf2018-05-111-26/+27
|
* refactoring: make FileIndex a distinct type; make line information an ↵Andreas Rumpf2018-04-211-1/+2
| | | | uint16; fixes #7654
* make tests green againAndreas Rumpf2018-03-241-3/+8
|
* fixes the 'var T' checkingAndreas Rumpf2018-03-241-5/+2
|
* more checking for 'var T' as return type; refs #7373Andreas Rumpf2018-03-241-1/+29
|
* basic 'lent T' test worksAndreas Rumpf2018-01-211-1/+4
|
* deprecated unary '<'Andreas Rumpf2017-10-291-3/+3
|
* support the full range of type modifiers when declaring concept vars and ↵Zahary Karadjov2017-03-241-0/+7
| | | | testing proc signatures
* fixes #4608Andreas Rumpf2016-10-181-0/+2
|
* some progress on #3832Andreas Rumpf2016-02-081-0/+3
|
* preparations for better handling of 'a[i]' in generics; stmt lists can be ↵Araq2015-09-121-1/+4
| | | | lvalues
* added system.unsafeAddrAraq2015-08-041-9/+11
|
* fix #2585 properlyAraq2015-04-221-1/+3
|
* fixes #2585Araq2015-04-221-1/+1
|
* implemented a[^1] notationAraq2015-03-261-3/+4
|
* fixes #2346Araq2015-03-161-2/+6
|
* fixes #1809; implements overloading based on 'var T'Araq2015-03-141-19/+22
|
* nimsuggest improvementsAraq2015-01-301-1/+1
|
* Nimrod renamed to NimAraq2014-08-281-1/+1
|
* implemented builtin noncopying sliceAraq2014-05-021-1/+4
|
* case consistency improvementsAraq2014-01-111-1/+1
|
* case consistency: next stepsAraq2013-12-291-4/+4
|
* case consistency part 4Araq2013-12-271-2/+2
|
* implemented large parts of the 'not nil' checkingAraq2013-06-091-0/+2
|
* make some tests greenAraq2013-03-031-4/+7
|
* constraint now part of the parameter symbol and not of the typeAraq2012-12-051-2/+2
|
* term rewriting improvementsAraq2012-09-081-3/+56
|
* activated tests for tr macrosAraq2012-09-061-3/+4
|
* bugfixes and improvements for term rewriting macrosAraq2012-09-041-1/+1
|