[Issue 24007] New: function/delegate literals cannot specify linkage
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 21 10:03:21 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24007
Issue ID: 24007
Summary: function/delegate literals cannot specify linkage
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: qs.il.paperinik at gmail.com
There is no way to express the linkage for a [function
literal](https://dlang.org/spec/expression.html#function_literals).
I suggest to add
[LinkageAttribute](https://dlang.org/spec/attribute.html#linkage) in the first
two production rules for `FunctionLiteral`:
```
FunctionLiteral:
function LinkageAttribute? RefOrAutoRef? Type? ParameterWithAttributes?
FunctionLiteralBody2
delegate LinkageAttribute? RefOrAutoRef? Type?
ParameterWithMemberAttributes? FunctionLiteralBody2
```
(Replaced opt with `?` for better readability.)
Linkage is niche enough to justify why it’s not needed in other production
rules.
--
More information about the Digitalmars-d-bugs
mailing list