D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13549 - Local functions don't take outer function attributes
Summary: Local functions don't take outer function attributes
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-28 05:40 UTC by Manu
Modified: 2018-10-10 22:30 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2014-09-28 05:40:52 UTC
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 bearophile_hugs 2014-09-28 08:47:53 UTC
See Issue 13550
Comment 2 Nathan S. 2018-10-10 22:30:11 UTC
Tested with DMD 2.082.0. Example code compiles without error.