Test case: struct S { void put(alias fun)() { fun!int(); } } void main() { static void foo(T)() {} S s; s.put!foo(); static void bar(alias fun)() { fun(); } void nested() {} bar!nested(); } In main, foo and bar are static template function. - When foo is instantiated in S.put, foo!int should not capture the frame of main function. - When bar is instantiated in main, it should capture the frame of main function for the alias template parameter `fun`, but bar itself should not capture any frame.
https://github.com/D-Programming-Language/dmd/pull/2794
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cfc81c56cd551bb366d978e9d016112ad8a6b6ea fix Issue 11533 - Compiler should allow to being nested for static local template functions https://github.com/D-Programming-Language/dmd/commit/07d776adfc8ded02da55805530c5f6dd454aee89 Merge pull request #2794 from 9rnsr/fix11533 Issue 11533 - Compiler should allow to being nested for static local template functions
*** Issue 7805 has been marked as a duplicate of this issue. ***
I'm reopening because the test case doesn't work with DMD 2.070.2: /d224/f50.d(11): Error: static function f50.main.bar!(nested).bar cannot access frame of function D main /d224/f50.d(13): Error: template instance f50.main.bar!(nested) error instantiating
(In reply to ZombineDev from comment #4) > I'm reopening because the test case doesn't work with DMD 2.070.2: > > /d224/f50.d(11): Error: static function f50.main.bar!(nested).bar cannot > access frame of function D main > /d224/f50.d(13): Error: template instance f50.main.bar!(nested) error > instantiating Oh, thanks for your reopen. The enhancement change was masked to _fix_ issue 11946. https://github.com/D-Programming-Language/dmd/pull/3884
*** This issue has been marked as a duplicate of issue 5710 ***