from: http://www.digitalmars.com/d/class.html
the example
class Foo
{
int x;
}
void test(Foo foo)
{
size_t o;
o = Foo.x.offsetof; // yields 8
}
t.d(12): Error: 'this' is only allowed in non-static member functions, not test
t.d(12): Error: this for x needs to be type Foo not type int
Comment #1 by tomas — 2007-02-18T20:50:25Z
Hey Frank,
don't you think that maybe in this one, severity could be marked as
something higher than normal?
Kind regards,
--
Tom;
[email protected] escribi
Comment #2 by benoit — 2007-02-19T13:14:30Z
> don't you think that maybe in this one, severity could be marked as
> something higher than normal?
Yes, i forgot about setting this.
Comment #3 by benoit — 2007-02-19T15:52:21Z
But note, this works:
class Foo{
int x;
static void foo(){
int o = x.offsetof; // works
}
}
Comment #6 by onlystupidspamhere — 2007-06-17T15:52:11Z
I'm marking this as a duplicate of #515. It's basically the same bug, but #515 is older and the description is a bit more precise.
*** This bug has been marked as a duplicate of 515 ***