summary refs log tree commit diff stats
path: root/tests/init
Commit message (Collapse)AuthorAgeFilesLines
* fixes `result` requires explicit initialization on noReturn code (#22717)ringabout2023-09-181-0/+27
| | | | | | fixes #21615; fixes #16735 It also partially fixes | #22673, though It still gives 'baseless' warnings.
* fixes branches interacting with break, raise etc. in strictdefs (#22627)ringabout2023-09-042-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```nim {.experimental: "strictdefs".} type Test = object id: int proc test(): Test = if true: return Test() else: return echo test() ``` I will tackle https://github.com/nim-lang/Nim/issues/16735 and #21615 in the following PR. The old code just premises that in branches ended with returns, raise statements etc. , all variables including the result variable are initialized for that branch. It's true for noreturn statements. But it is false for the result variable in a branch tailing with a return statement, in which the result variable is not initialized. The solution is not perfect for usages below branch statements with the result variable uninitialized, but it should suffice for now, which gives a proper warning. It also fixes ```nim {.experimental: "strictdefs".} type Test = object id: int proc foo {.noreturn.} = discard proc test9(x: bool): Test = if x: foo() else: foo() ``` which gives a warning, but shouldn't
* fixes cascades of out parameters, which produces wrong ProveInit warnings ↵ringabout2023-08-091-0/+14
| | | | (#22413)
* some test cleanups & category reorganization (#22010)metagn2023-06-062-0/+42
| | | | | | | | | | | | | | | | | * clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
* fixes #21043; fixes a named exception in the infixAs expression which ↵ringabout2022-12-121-1/+22
| | | | | | | | | | | generate an implicit uninitialized let statement (#21081) * fixes #21043; fixes a named exception in the infixAs expression which generate an implicit uninitialized let statement * Update compiler/sempass2.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* definite assignment analysis for let (#21024)ringabout2022-12-064-0/+75
| | | | | | | | | | | | | | | | | | | * draft for let daa * patch * fixes bugs * errors for global let variable reassignments * checkpoint * out param accepts let * add more tests * add documentation * merge tests
* DAA and 'out' parameters (#20506)Andreas Rumpf2022-10-063-1/+84
| | | | | | | | | | | * DAA and 'out' parameters * progress * documented strictDefs and out parameters * docs, tests and a bugfix * fixes silly regression
* close #17636 (#17643)flywind2021-04-061-2/+1
|
* fix #16693: testament spec nimout too lax (#16698)flywind2021-04-041-1/+1
| | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-1/+1
| | | | | | | | | | | * 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
* activated more tests, allow input in test specArne Döring2018-11-231-1/+2
|
* make run the default action of a test in testerArne Döring2018-11-231-2/+8
|
* Extend init variable tracking to tuple assignments (#8321)LemonBoy2018-07-171-0/+21
| | | Fixes #8314
* make tests green againAndreas Rumpf2018-07-051-1/+1
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-4/+4
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* fixes #2316Araq2015-03-111-0/+54
|
* made some tests greenAraq2014-08-131-1/+1
|
* new tester; all tests categorizedAraq2014-01-132-0/+54