| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
fixes #21615; fixes #16735
It also partially fixes | #22673, though It still gives 'baseless'
warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```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
|
|
|
|
| |
(#22413)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* progress
* documented strictDefs and out parameters
* docs, tests and a bugfix
* fixes silly regression
|
| |
|
|
|
| |
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 #8314
|
| |
|
|
|
|
| |
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
|
| |
|
| |
|
|
|