mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
18 lines
538 B
Text
18 lines
538 B
Text
Keywords `auto` and `ref` must be adjacent
|
|
|
|
It's now deprecated to declare `auto ref` parameters without putting those two keywords next to each other.
|
|
This way it's clear that `auto ref` semantics are intended, rather than `ref` and `auto` semantics separately.
|
|
For the newly introduced $(RELATIVE_LINK2 dmd.reflocal, `ref` local / global variables), it's an error immediately.
|
|
|
|
---
|
|
void t()(ref const auto int x) // Deprecation
|
|
{
|
|
ref auto y = x; // Error
|
|
}
|
|
|
|
// Correction:
|
|
void t()(auto ref const int x)
|
|
{
|
|
auto ref y = x;
|
|
}
|
|
---
|