Bug 2828 – Typedef'ed template struct incorrectly recognized as an inner struct

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-04-10T02:11:00Z
Last change time
2015-06-09T01:18:02Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
sludwig

Attachments

IDFilenameSummaryContent-TypeSize
3212828_evil-cast.diffRemove incorrect cast, resolve basetype.text/plain670

Comments

Comment #0 by sludwig — 2009-04-10T02:11:13Z
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]
Comment #2 by clugdbug — 2010-11-16T04:59:58Z
Fixed svn 614.