| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23627
```nim
type
TestObj = object of RootObj
TestTestObj = object of RootObj
testo: TestObj
proc `=destroy`(x: TestTestObj) =
echo "Destructor for TestTestObj"
proc testCaseT() =
echo "\nTest Case T"
let tt1 {.used.} = TestTestObj(testo: TestObj())
```
When generating const object fields, it's likely that
we need to generate type infos for the object, which may be an object
with
custom hooks. We need to generate potential consts in the hooks first.
https://github.com/nim-lang/Nim/pull/20433 changed the semantics of
initialization. It should evaluate`BracedInit` first.
|
|
|
|
|
| |
ref https://forum.nim-lang.org/t/11587
Tested with `gcc version 14.0.1 20240412` locally
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23524
```nim
proc isAnalysableFieldAccess*(orig: PNode; owner: PSym): bool =
...
result = n.kind == nkSym and n.sym.owner == owner and
{sfGlobal, sfThread, sfCursor} * n.sym.flags == {} and
(n.sym.kind != skParam or isSinkParam(n.sym))
```
In `isAnalysableFieldAccess`, globals, cursors are already rejected
|
|
|
|
|
| |
refs (#23507)
fixes #23505
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which corrupts the compiler (#23271)
fixes #22909
required by https://github.com/nim-lang/Nim/pull/23267
```nim
proc foo: string =
assert false
result = ""
```
In the function `foo`, `assert false` raises an exception, which can
cause `result` to be uninitialized if the default result initialization
is optimized out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes #23247
closes #23251 (which accounts for why the openarray type is lifted
because ops are lifted for openarray conversions)
related: https://github.com/nim-lang/Nim/pull/18713
It seems to me that openarray doesn't own the data, so it cannot destroy
itself. The same case should be applied to
https://github.com/nim-lang/Nim/issues/19435. It shouldn't be destroyed
even openarray can have a destructor. A cleanup will be followed for
https://github.com/nim-lang/Nim/pull/19723 if it makes sense.
According to https://github.com/nim-lang/Nim/pull/12073, it lifts
destructor for openarray when openarray is sunk into the function, when
means `sink openarray` owns the data and needs to destroy it. In other
cases, destructor shouldn't be lifted for `openarray` in the first place
and it shouldn't destroy the data if it doesn't own it.
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
fixes #22218
|
|
|
| |
fixes #22923
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#22975)
fixes #22286
ref https://forum.nim-lang.org/t/10642
For backwards compatibilities, we might need to keep the changes under a
preview compiler flag. Let's see how many packags it break.
**TODO** in the following PRs
- [ ] Turn the `var T` destructors warning into an error with
`nimPreviewNonVarDestructor`
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
| |
custom destructors (#22901)
fixes #22866;
fixes #19998
|
|
|
|
|
|
|
|
|
|
|
| |
containsManagedMemory(n.typ) (#22823)
fixes #19250
fixes #22259
The strings, seqs, refs types all have this flag, why should closures be
treated differently?
follow up https://github.com/nim-lang/Nim/pull/14336
|
|
|
|
|
|
|
|
|
| |
(#22800)
fixes #22787
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
`{.push overflowChecks: off.}` works in backends. Though it could be
implemented as a magic function.
By inspecting the generated C code, the overflow check is eliminated in
the debug or release mode.

Likewise, the index checking is probably not needed.
|
|
|
| |
fixes #22664
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* round out tuple unpacking assignment, support underscores
fixes #18710
* fix test messages
* use discard instead of continue
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
| |
closed #22748; cursorinference + -d:nimNoLentIterators results in erroneous recursion
|
|
|
|
|
| |
loop in ORC (#22240)
fixes #22237; fixes #21160; wrong cursor on unowned parameters
|
| |
|
| |
|
|
|
| |
the function actually returns
|
|
|
|
|
| |
* fixes #22001
* added test case
|
|
|
|
|
|
|
| |
* adds =destroy T support for strings and seqs
* fixes system
* fixes tests
|
| |
|
|
|
|
|
|
|
| |
`nodestroy` pragma (#21992)
* fixes #21987; don't create type bound ops for anything in a function with a `nodestroy` pragma
* add a comment
|
|
|
|
|
|
| |
* fixes tests again
* remove helper functions
* fixes closures, owned refs
* final cleanup
|
|
|
|
|
| |
* fixes #21974; fixes sameConstant fieldDefect
* add a test case
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* adds documentation for `=wasMoved` and `=dup` hooks and small fixes
* Update doc/destructors.md
* Update doc/destructors.md
---------
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
| |
* ORC: make rootsThreshold thread local [backport]
* fixes the regression
|
|
|
|
|
|
|
|
|
| |
* Revert "ORC: make rootsThreshold thread local [backport] (#21799)"
This reverts commit b74d49c037734079765770426d0f5c79dee6cf87.
* Revert "fixes #21752 [backport] (#21802)"
This reverts commit d0c62fa169f3970653ce0d5bbd16e123efb24251.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* import `=dup` hook eliminating `wasMoved` and `=copy` pairs
* add dup
* add a test for dup
* fixes documentation
* fixes signature
* resolve comments
* fixes tests
* fixes tests
* clean up
|
| |
|
|
|
|
|
|
|
| |
generics (#21619)
* fixes #21617; createTypeBoundOps with PContext in order to instantiate generics
* keep idgen
|
|
|
|
|
|
|
| |
dispatcher for ORC (#21594)
* fixes #21592; create type operations for the method dispatcher
* add a test case
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tuple unpacking for vars as just sugar, allowing nesting
* set temp symbol AST
* hopeful fix some issues, add test for #19364
* always use temp for consts
* document, fix small issue
* fix manual indentation
* actually fix manual
* use helper proc
* don't resem temp tuple assignment
|
|
|
|
|
| |
* fixes #20993 [backport:1.6]
* proper line endings for the test file
|
|
|
| |
fixes #14255; Crash in compiler when using system.any by accident.
|
|
|
|
|
|
|
|
|
|
|
| |
* fix #18977 disallow change branch of an object variant in ORC
* check errors for goto exception
* fixes conditions
* fixes tests
* add a test case for #18977
|
|
|
| |
fixes #19857; Exception raised in closure may be "skipped"
|
|
|
|
|
|
|
|
|
| |
* fixes #21023; Segfault when mixing seqs, orc, variants and futures
* fixes none of the branches were explicitly selected
* add one more test
* one more test
|
|
|
|
|
| |
(#21459)
fixes #20422; emit nimPrepareStrMutationV2 for toOpenArray to keep the abstraction of mutable strings which have immutable string literals
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #19291; implements `wasMoved` hook
* basics
* checkpoint
* finish `wasMoved`
* add a test for #19291
* add documentation and changelog
* work `attachedWasMoved` with generics
* fixes optimizer
* register `=wasMoved`
* handle wasMoved magcis
* check another round
* some patches
* try `op == nil`
* nicer
* generate `wasMoved` before `destroy`
* try again
* fixes tests
* default wasMoved
* Update tests/destructor/tv2_cast.nim
* Update tests/destructor/tv2_cast.nim
* Update tests/arc/topt_refcursors.nim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parses the whole module at one time (#21379)
* fixes #19795; remove parse pipeline
* isScript
* fixes nimscriptapi
* don't touch reorder
* check script
* fixes tests
* it seems implicit imports of system cause troubles
* access the first child of `nkStmtList`
* ignore comments
* minor messages
* perhaps increases hloLoopDetector
* the module is a stmtList, which changes the errors
* fixes nimdoc
* fixes tlinter
* fixes nim secret tests
* fixes arc_misc
* fixes nim secret tests again
* safe; fixes one more test
* GlobalError is the root cause too
* fixes parsing errors
* put emit types to the cfsForwardTypes section
* fixes #11852; `{.push checks:off}` now works in procs
* disable navigator
* fixes nimdoc
* add tests for JS
* fixes nimsuggest
|
|
|
|
|
|
|
| |
* fixes #21171; dyn destructors for acyclic inherited refs
* add a test
* Update compiler/liftdestructors.nim
|
| |
|
|
|
|
|
| |
* bounchecks for len(toOpenArray())
* add a testcase
|
|
|
|
|
|
|
|
|
| |
* rename `std/threads` to `std/oldthreads`
* fixes tests
* rename to `typedthreads`
* changelog
|
|
|
|
|
| |
* fixes an ARC bug
* add a testcase
|
| |
|