www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7190] New: Tuple length incorrect

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7190

           Summary: Tuple length incorrect
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



16:26:53 GMT ---
Created an attachment (id=1064)
Files required to reproduce

When compiling the attached code ( https://gist.github.com/7faf1013f81ea96bfb89
), the following error is given:
----
serenity/core/Model.d(2): Error: static assert  "Article(1):
tuple((Article).id)"
example/models/HomeModel.d(10):        instantiated from here:
SqlitePersister!(Article)
----
Note that the code requires the following directory/file layout:
serenity
 ` core
     ` Model.d
     ` Controller.d
example
 ` controllers
     ` HomeController.d
 ` models
      ` HomeModel.d

And should be compiled with:
dmd -c example/controllers/HomeController.d example/models/HomeModel.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 31 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7190




This is a forward reference bug.

Workaround in core/Model.d:

 class SqlitePersister(T) {
+    static assert(T.sizeof);  // force running semantic of T
+                              // to resolve sizeof property
     static assert(T.tupleof.length > 0, T.stringof ~ `(` ~ (T.tupleof.length
                                             + '0') ~ `): ` ~
T.tupleof.stringof);
 }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7190


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Platform|Other                       |All



https://github.com/D-Programming-Language/dmd/pull/595

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7190


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



17:14:27 PST ---
https://github.com/D-Programming-Language/dmd/commit/39124548bdab79769afe5699c50fe6e79421bcda

https://github.com/D-Programming-Language/dmd/commit/3d4b0b6d6f82bd03ce57e581cbe16e8fb4af0d7a

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