[Issue 23520] pragma(inline, false) not applied to nested function declaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 1 13:09:37 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23520
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to RazvanN from comment #1)
> 1. We can implement the expected behavior by attaching the pragma to the
> declaration, but given the existing machinery in the compiler this will
> require a lot of rework to transform the existing pragma statement into a
> pragma declaration and hook in to the existing implementation.
Why do you think so?
The parser looks like this:
---
if (token.value == TOK.semicolon)
{
nextToken();
_body = null;
}
else
_body = parseStatement(ParseStatementFlags.semi);
s = new AST.PragmaStatement(loc, ident, args, _body);
break;
---
A standalone `pragma(inline);` statement will have no `_body`. This can be
checked at semantic with no invasive changes.
--
More information about the Digitalmars-d-bugs
mailing list