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; } ---
Created attachment 321 [details] 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]
Fixed svn 614.