[Issue 20814] New: Fail to compile with scope - what is reason for restriction?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 9 11:10:43 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20814

          Issue ID: 20814
           Summary: Fail to compile with scope - what is reason for
                    restriction?
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: apz28 at hotmail.com

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;        
    }

--


More information about the Digitalmars-d-bugs mailing list