Summary: Typedef'ed template struct incorrectly recognized as an
                    inner struct
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

The following code fragment errors out with

bug_innerstruct.d(3): Error: struct bug_innerstruct.Test inner struct MyVariant
cannot be a field

Changing typedef to alias makes the code compile again.

struct Variant(T...) { T members; }
typedef Variant!(int, float) MyVariant;
struct Test { MyVariant v; }


Reply via email to