← Back to index
|
Original Bugzilla link
Bug 10180 – offsetof doesn't work through function call alias this
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-26T22:22:00Z
Last change time
2013-05-27T09:23:38Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0
by k.hara.pg — 2013-05-26T22:22:11Z
template TypeTuple(TL...) { alias TypeTuple = TL; } template Identity(alias T) { alias Identity = T; } struct Tuple(Specs...) { static if (is(Specs)) { alias Types = Specs; Types expand; alias expand this; } else { alias Types = TypeTuple!(Specs[0]); Types expand; mixin("alias Identity!(expand[0]) "~Specs[1]~";"); @property ref Tuple!(Specs[0]) _Tuple_super() { return *cast(typeof(return)*) (&expand[0]); } alias _Tuple_super this; } } void main() { Tuple!(int, "a") x; auto o1 = x.a.offsetof; // OK auto o2 = x[0].offsetof; // NG: no property 'offsetof' for type 'int' auto o3 = x._Tuple_super[0].offsetof; // same as above }
Comment #1
by k.hara.pg — 2013-05-26T22:54:00Z
https://github.com/D-Programming-Language/dmd/pull/2085
Comment #2
by github-bugzilla — 2013-05-27T06:20:46Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/55aca1092743f8dd212f75abfab14222a03ce427
fix Issue 10180 - offsetof doesn't work through function call alias this
https://github.com/D-Programming-Language/dmd/commit/07909949f81479425cd89c74ba2a617b6f85d0eb
Merge pull request #2085 from 9rnsr/fix10180 Issue 10180 - offsetof doesn't work through function call alias this