diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-06-21 14:51:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 08:51:03 +0200 |
commit | a345cde26e15ef8e1c905c48507195739fab4515 (patch) | |
tree | 400a569b50add80200b548739a0986291ccf64e4 /changelogs | |
parent | db41f04ab0734b0ac5267b46f306b0a311f7fc71 (diff) | |
download | Nim-a345cde26e15ef8e1c905c48507195739fab4515.tar.gz |
allow destructors to accept non var parameters; deprecate `proc =destroy(x: var T)` (#22130)
* make destructors accept non var parameters * define nimAllowNonVarDestructor * add a test case and a changelog * update documentation and error messages * deprecate destructors taking 'var T'
Diffstat (limited to 'changelogs')
-rw-r--r-- | changelogs/changelog_2_0_0.md | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/changelogs/changelog_2_0_0.md b/changelogs/changelog_2_0_0.md index 5707cf955..b56a3e71c 100644 --- a/changelogs/changelog_2_0_0.md +++ b/changelogs/changelog_2_0_0.md @@ -258,6 +258,8 @@ - `strutils.split` and `strutils.rsplit` now forbid an empty separator. +- Custom destructors now supports non-var parameters, e.g. `proc =destroy[T: object](x: T)` is valid. `proc =destroy[T: object](x: var T)` is deprecated. + - Relative imports will not resolve to searched paths anymore, e.g. `import ./tables` now reports an error properly. ## Standard library additions and changes |