mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Require adjacent auto ref return as well (#21061)
This commit is contained in:
parent
8a96c4745c
commit
31bfe613b0
3 changed files with 34 additions and 9 deletions
12
changelog/dmd.auto-ref-return.dd
Normal file
12
changelog/dmd.auto-ref-return.dd
Normal file
|
@ -0,0 +1,12 @@
|
|||
Keywords `auto` and `ref` must be adjacent for `auto ref` return.
|
||||
|
||||
Similar to `auto ref` parameters in 2.111, it's now deprecated to declare an `auto ref` return type without putting those two keywords next to each other as well.
|
||||
|
||||
---
|
||||
ref auto int f() => 3;
|
||||
auto { ref int g() => 3; }
|
||||
|
||||
// Correction:
|
||||
auto ref f() => 3;
|
||||
auto ref g() => 3;
|
||||
---
|
Loading…
Add table
Add a link
Reference in a new issue