diff options
author | metagn <metagngn@gmail.com> | 2023-01-08 08:49:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 06:49:49 +0100 |
commit | 05c6db6500de0551882a2d6cc612c9afb6ca674c (patch) | |
tree | 2b7492ae69524ed95384a160d048a573f969cf84 /changelogs | |
parent | b34412ff0fb450278d8c93f6e5d7bf0e8d3f0a0b (diff) | |
download | Nim-05c6db6500de0551882a2d6cc612c9afb6ca674c.tar.gz |
underscores for routine parameters (#21192)
* underscores for routine parameters fixes #13443, fixes #13804, refs #21121 * add changelog + more tests * support generics and ensure inferred lambdas work
Diffstat (limited to 'changelogs')
-rw-r--r-- | changelogs/changelog_2_0_0.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/changelogs/changelog_2_0_0.md b/changelogs/changelog_2_0_0.md index 9ff493b54..c8427cc2a 100644 --- a/changelogs/changelog_2_0_0.md +++ b/changelogs/changelog_2_0_0.md @@ -135,6 +135,21 @@ - The experimental strictFuncs feature now disallows a store to the heap via a `ref` or `ptr` indirection. +- Underscores (`_`) as routine parameters are now ignored and cannot be used in the routine body. + The following code now does not compile: + + ```nim + proc foo(_: int): int = _ + 1 + echo foo(1) + ``` + + Instead, the following code now compiles: + + ```nim + proc foo(_, _: int): int = 123 + echo foo(1, 2) + ``` + - - Added the `--legacy:verboseTypeMismatch` switch to get legacy type mismatch error messages. ## Standard library additions and changes |