Reduced:
```
import std.typecons;
void main()
{
// Error: found `opp` when expecting `;` following statement `Tuple!(int, int)` on line
Tuple!(int, int) opp(int x, int y) => tuple(x + y, x - y); // no ok
}
```
BTW that error message has been improved in git master, it now says:
ft.d(12): Error: found `opp` when expecting `;` following expression
ft.d(12): expression: `Tuple!(int, int)`
Comment #2 by nick — 2023-08-16T20:12:28Z
Reduced:
```
struct S(T) {}
void main()
{
S!int f() => S!int();
}
```
I think I have a fix for isDeclarator in parse.d, will submit tomorrow.
Comment #3 by dlang-bot — 2023-08-16T23:05:08Z
@maxhaton created dlang/dmd pull request #15542 "Fix Issue 24088 - Nested functions using the shortened syntax were no…" fixing this issue:
- Fix Issue 24088 - Nested functions using the shortened syntax were not recognized correctly as declarations.
The fix was simply to amend `isDeclarator` to look for TOK.goesTo (i.e. `=>`)
https://github.com/dlang/dmd/pull/15542
Comment #4 by dlang-bot — 2023-08-17T10:33:11Z
dlang/dmd pull request #15542 "Fix Issue 24088 - Nested functions using the shortened syntax were no…" was merged into stable:
- 2504a1fdd429abf85fca02885ba527d741e70098 by mhh:
Fix Issue 24088 - Nested functions using the shortened syntax were not recognized correctly as declarations.
The fix was simply to amend `isDeclarator` to look for TOK.goesTo (i.e. `=>`)
https://github.com/dlang/dmd/pull/15542
Comment #5 by dlang-bot — 2023-09-16T07:31:13Z
dlang/dmd pull request #15609 "merge stable" was merged into master:
- e3eccfe9a5d721ea5dd1e4ab1d9bff7c6ae91ac4 by mhh:
Fix Issue 24088 - Nested functions using the shortened syntax were not recognized correctly as declarations.
The fix was simply to amend `isDeclarator` to look for TOK.goesTo (i.e. `=>`)
https://github.com/dlang/dmd/pull/15609