The compiler accepts the following:
```
alias func = (auto c) {};
```
But when instantiation `func` with some value it fails:
```
func(4);
```
Producing the following error:
```
onlineapp.d(4): Error: `auto` can only be used as part of `auto ref` for template function parameters
onlineapp.d(5): Error: template `D main.__lambda1` cannot deduce function from argument types `!()(int)`
onlineapp.d(4): Candidate is: `__lambda1`
```
We should either fail when declaring lambdas with auto or add support for it. If we want to add support for this, templates should also cover it, to make it consistent with all the language semantics.
Comment #1 by robert.schadek — 2024-12-13T19:20:30Z