Bug 20922 – Cannot get frame pointer in templated member function

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-06-11T08:47:36Z
Last change time
2024-03-19T10:05:37Z
Assigned to
No Owner
Creator
Simen Kjaeraas
See also
https://issues.dlang.org/show_bug.cgi?id=20921, https://issues.dlang.org/show_bug.cgi?id=5710

Comments

Comment #0 by simen.kjaras — 2020-06-11T08:47:36Z
struct S { int i; void fun() { // Works fine outside!(() => i); // inside cannot get frame pointer to S.fun.__lambda2 inside!(() => i); } void inside(alias fn)() { fn(); } } void outside(alias fn)() { fn(); } It seems more than a little counterintuitive that outside() can get a frame pointer from S.fun() while inside() cannot. I expect both to compile.
Comment #1 by dfj1esp02 — 2024-03-19T09:51:58Z
*** This issue has been marked as a duplicate of issue 5710 ***
Comment #2 by dfj1esp02 — 2024-03-19T10:05:37Z
*** Issue 21697 has been marked as a duplicate of this issue. ***