www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2828] New: Typedef'ed template struct incorrectly recognized as an inner struct

reply d-bugmail puremagic.com writes:
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; }
---


-- 
Apr 10 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2828






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]


-- 
Apr 11 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2828


Don <clugdbug yahoo.com.au> changed:

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



Fixed svn 614.

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