summary refs log tree commit diff stats
path: root/changelogs
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-01-08 08:49:49 +0300
committerGitHub <noreply@github.com>2023-01-08 06:49:49 +0100
commit05c6db6500de0551882a2d6cc612c9afb6ca674c (patch)
tree2b7492ae69524ed95384a160d048a573f969cf84 /changelogs
parentb34412ff0fb450278d8c93f6e5d7bf0e8d3f0a0b (diff)
downloadNim-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.md15
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