Bug 20814 – Fail to compile with scope - what is reason for restriction?
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-05-09T11:10:43Z
Last change time
2021-06-16T06:02:25Z
Assigned to
No Owner
Creator
apham
Comments
Comment #0 by apz28 — 2020-05-09T11:10:43Z
Fail with message "Error: no size because of forward references"
struct S
{
alias D = void delegate(scope ref S value);
int v;
D dg;
}
Remove 'scope' and it is fine
struct S
{
alias D = void delegate(ref S value);
int v;
D dg;
}
Comment #1 by pro.mathias.lang — 2021-06-16T06:02:25Z
Indeed that is a bug. Marking as duplicate of 21667 as the later is another case of the same issue.
*** This issue has been marked as a duplicate of issue 21667 ***