Thread overview
[Issue 2828] New: Typedef'ed template struct incorrectly recognized as an inner struct
Apr 10, 2009
d-bugmail
Apr 11, 2009
d-bugmail
Nov 16, 2010
Don
April 10, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2828

           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
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: ludwig@informatik.uni-luebeck.de


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; }
---


-- 

April 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2828





------- Comment #1 from unknown@simplemachines.org  2009-04-11 14:57 -------
Created an attachment (id=321)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=321&action=view)
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]


-- 

November 16, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2828


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2010-11-16 04:59:58 PST ---
Fixed svn 614.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------