www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21667] New: scope parameter causes 'no size because of


          Issue ID: 21667
           Summary: scope parameter causes 'no size because of forward
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

I changed a parameter to have the `scope` storage class, and suddenly got an
error that didn't follow from the change: "no size because of forward
references". Test case:

struct M
    F.Type f;

struct F
    enum Type {a}
    void foo(scope M m) {}

Without the `scope`, it compiles. I think the problem is that `scope` makes the
compiler check whether type M has pointers, calling `determineFields` on M,
which fails because it wants semantic analysis of F to be done for F.Type.

Feb 27 2021