Bug 7190 – Tuple length incorrect

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-12-31T08:26:00Z
Last change time
2017-07-19T04:54:30Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
robert
See also
https://issues.dlang.org/show_bug.cgi?id=7464

Attachments

IDFilenameSummaryContent-TypeSize
1064serenity.tar.gzFiles required to reproduceapplication/x-gzip1016

Comments

Comment #0 by robert — 2011-12-31T08:26:53Z
Created attachment 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
Comment #1 by k.hara.pg — 2012-01-01T06:37:02Z
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); }
Comment #2 by k.hara.pg — 2012-01-01T07:23:02Z
Comment #3 by bugzilla — 2012-01-01T17:14:27Z