Bug 13549 – Local functions don't take outer function attributes
Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-28T05:40:52Z
Last change time
2018-10-10T22:30:11Z
Assigned to
No Owner
Creator
Manu
Comments
Comment #0 by turkeyman — 2014-09-28T05:40:52Z
void f() pure nothrow @nogc
{
static void localFunc()
{
}
localFunc();
}
Complains because localFunc is not @nogc or nothrow.
Doesn't complain about pure though.
My feeling is that the attributes should apply to everything in the scope that they attribute?
Comment #1 by bearophile_hugs — 2014-09-28T08:47:53Z
See Issue 13550
Comment #2 by n8sh.secondary — 2018-10-10T22:30:11Z
Tested with DMD 2.082.0. Example code compiles without error.