Bug 15298 – Can't call nested template function unless it's anonymous

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-07T01:07:30Z
Last change time
2024-12-13T18:45:41Z
Keywords
pull, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#17733 →

Comments

Comment #0 by dlang-bugzilla — 2015-11-07T01:07:30Z
///////////////////////// test.d ///////////////////////// // Call alias with a parameter. void callAlias(alias f)() { f(42); } alias Identity(alias X) = X; void main() { int local; // Declare an anonymous function template // which writes to a local. alias a = Identity!((i) { local = i; }); // Declare a function template which does // the same thing. void b(T)(T i) { local = i; } callAlias!a; // Works callAlias!b; // Error: function test.main.b!int.b is a // nested function and cannot be accessed // from test.callAlias!(b).callAlias } ////////////////////////////////////////////////////////// As far as I can tell, a and b are essentially the same, except one is anonymous.
Comment #1 by dlang-bot — 2021-08-23T14:39:10Z
@ibuclaw created dlang/dmd pull request #13006 "fix Issue 15298 - Can't call nested template function unless it's anonymous" fixing this issue: - fix Issue 15298 - Can't call nested template function unless it's anonymous https://github.com/dlang/dmd/pull/13006
Comment #2 by robert.schadek — 2024-12-13T18:45:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17733 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB