Bug 24007 – function/delegate literals cannot specify linkage

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-06-21T10:03:21Z
Last change time
2024-12-13T19:29:51Z
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#20304 →

Comments

Comment #0 by qs.il.paperinik — 2023-06-21T10:03:21Z
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.
Comment #1 by robert.schadek — 2024-12-13T19:29:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20304 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB