The grammar on Dlang.org tells me that "final" is a valid attribute on function parameters (see "InOutX"), however I cannot find documentation of what that means. dmd does not accept it on normal function parameters, only on template parameters:
void foo(final int a); // error!
void bar(T)(final T a); // OK
We should either add documentation on what "final" means for a function parameter, or fix the grammar if it is (no longer?) supported.
Thanks for any explanation,
Johan
Comment #1 by dlang-bot — 2022-07-24T12:38:05Z
@ntrel created dlang/dlang.org pull request #3354 "Fix Issue 15379 - "final" attribute on function parameter" fixing this issue:
- Fix Issue 15379 - "final" attribute on function parameter
`final` is not allowed in D2.
```d
void foo(final int a){} // error!
```
```
finalpar.d(1): Error: variable `finalpar.foo.a` cannot be `final`, perhaps you meant `const`?
```
https://github.com/dlang/dlang.org/pull/3354