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; }
---
Comment #1 by bugs-d — 2009-04-11T14:57:09Z
Created attachment 321
Remove incorrect cast, resolve basetype.
This patch fixes it, so it acts just like an alias, by resolving the base type.
The intended check still works, this just resolves the TypedefDeclaration to a StructDeclaration. I also removed the cast in favor of the safer isStructDeclaration().
-[Unknown]