Comment #0 by razvan.nitu1305 — 2023-04-20T08:27:05Z
void main()
{
immutable int c;
int function(int x) func;
func = x => c;
}
(13): Error: function `main.__lambda3(__T1)(x)` cannot access variable `c` in frame of function `D main`
There are 2 problems:
1. __lambda3 is a compiler generated identifier that should not see the light of a screen.
2. the compiler say `function` but what it outputs is actually a template declaration.
A better error message would look like: "Error: lambda function: `x => c` cannot access variable `c` in frame of function main.
Comment #1 by robert.schadek — 2024-12-13T19:28:20Z