digitalmars.D.bugs - [Issue 19026] New: Aliasing an inner function gets context but
- d-bugmail puremagic.com (31/31) Jun 25 2018 https://issues.dlang.org/show_bug.cgi?id=19026
https://issues.dlang.org/show_bug.cgi?id=19026 Issue ID: 19026 Summary: Aliasing an inner function gets context but aliasing a member function through instance does not Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity: enhancement Priority: P3 Component: dmd Assignee: nobody puremagic.com Reporter: ali.akhtarzada gmail.com Based on this forum thread: https://forum.dlang.org/thread/hyforteterjqhgghpshw forum.dlang.org Aliasing an inner function seems inconsistent with aliasing a member function in that the former aliases the contexted function whereas the latter not: void main() { struct S { void f() {} } S s; void f() {} alias inner = f; alias member = s.f; pragma(msg, typeof(&inner)); // delegate pragma(msg, typeof(&member)); // function } so inner() can be called but not member() as you get: Error: need this for f of type void() --
Jun 25 2018