Skip to content

Commit

Permalink
Add mention of breaking change about [_] in generics to changelog (n…
Browse files Browse the repository at this point in the history
…im-lang#21437)

Add mention of breaking change to changelog

As described by nim-lang#21435 , generic proc declarations making use of `_` as generic
parameter are no longer possible. This is a change that was introduced by 
nim-lang#21192 . During the debate over if this should be part of the intended spec in
nim-lang#21435 we concluded that it is and thus should be mentioned as a breaking
change in the changelogs.
  • Loading branch information
PhilippMDoerner authored and bung87 committed Jul 29, 2023
1 parent 9fb00f4 commit d96ff89
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions changelogs/changelog_2_0_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@
proc foo(_, _: int): int = 123
echo foo(1, 2)
```
- Underscores (`_`) as generic parameters are not supported and cannot be used.
Generics that use `_` as parameters will no longer compile requires you to replace `_` with something else:

```nim
proc foo[_](t: typedesc[_]): string = "BAR" # Can not compile
proc foo[T](t: typedesc[T]): string = "BAR" # Can compile
```

- - Added the `--legacy:verboseTypeMismatch` switch to get legacy type mismatch error messages.

Expand Down

0 comments on commit d96ff89

Please sign in to comment.