Bug 10504 – Tuple error: no property 'offsetof' for type 'int'
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-29T11:07:00Z
Last change time
2013-09-28T23:13:19Z
Assigned to
nobody
Creator
ibuclaw
Comments
Comment #0 by ibuclaw — 2013-06-29T11:07:46Z
This test is one of the unittests in std.typecons.
https://github.com/D-Programming-Language/phobos/blob/master/std/typecons.d#L622
The autotester passes, so apparently it *should* work *somehow*, but trying to compile std.typecons alone with -unittest fails with:
Error: no property 'offsetof' for type 'int'
Error: no property 'offsetof' for type 'double'
Among some other errors and a nice SEGV, but I'll ignore that for the time being... This particular error is a show stopper for the autotester for gdc passing.
Reduced test:
---
import std.typecons;
void main()
{
Tuple!(int, "a", double, "b") x;
static assert(x.a.offsetof == x[0].offsetof);
static assert(x.b.offsetof == x[1].offsetof);
}
Comment #1 by andrej.mitrovich — 2013-06-29T16:57:05Z
I've tried with 2.063.1, 2.063.2 and git-head but couldn't reproduce. I'm on win32, perhaps it's a platform-specific bug, although I kind of doubt it.
Comment #2 by bearophile_hugs — 2013-06-29T17:08:11Z
(In reply to comment #1)
> I've tried with 2.063.1, 2.063.2 and git-head but couldn't reproduce. I'm on
> win32, perhaps it's a platform-specific bug, although I kind of doubt it.
I have tried various combinations on dpaste (64 bit) and I have seen no errors.
Comment #3 by ibuclaw — 2013-06-29T17:13:35Z
I do believe mine is dmd 2.063.0 64bit (these point versions make things a bit complicated when it comes to testers. =)
Comment #4 by ibuclaw — 2013-06-29T17:19:15Z
Hmm... I can reproduce on all (debian package 2.063.0, 2.063.2, and zip 2.063.2). Marking this as Linux-only if you windows guys have no problem.
Could be library bug rather than compiler perhaps...
Comment #5 by ibuclaw — 2013-06-29T17:59:05Z
Actually, I have just realised that was testing in the gdc libphobos folder, so dmd would be pulling in gdc's libphobos, rather than dmd's.
I see there are lots of differences between std.typecons in 2.063.0->2.063.2 so I'll upgrade my frontend to that new point release and retry...
Comment #6 by k.hara.pg — 2013-06-30T01:27:42Z
Lack of fixing issue 10180?
Comment #7 by ibuclaw — 2013-06-30T04:41:23Z
(In reply to comment #6)
> Lack of fixing issue 10180?
Possibly... but that fixed isn't in 2.063.x
Comment #8 by k.hara.pg — 2013-06-30T06:03:50Z
(In reply to comment #7)
> (In reply to comment #6)
> > Lack of fixing issue 10180?
>
> Possibly... but that fixed isn't in 2.063.x
Yes. But, at the same time, 2.063.x Phobos does not contain my Tuple improvement.
https://github.com/D-Programming-Language/phobos/pull/1308
So the issue would occur only with 2.063.x release dmd + git head Phobos