August 10, 2005
class Foo {
	void Bar()
	{
		struct tmpStruct {
			int blah;
		};
		static assert(tmpStruct.blah.offsetof==0);
	}
}

------

> dmd test.d
test.d(7): this for blah needs to be type tmpStruct not type test.Foo
test.d(7): class test.Foo member blah is not accessible

------

Using other properties (like sizeof) seems to work, as it works when the function is not within a class. It has nothing to do with static assert, as writefln()ing the offsetof also doesn't work..

DMD 0.129 on WinXP.


xs0
August 13, 2005
xs0 schrieb:
> class Foo {
>     void Bar()
>     {
>         struct tmpStruct {
>             int blah;
>         };
>         static assert(tmpStruct.blah.offsetof==0);
>     }
> }
> 
> ------
> 
>> dmd test.d
> test.d(7): this for blah needs to be type tmpStruct not type test.Foo
> test.d(7): class test.Foo member blah is not accessible
> 
> ------
> 
> Using other properties (like sizeof) seems to work, as it works when the
> function is not within a class. It has nothing to do with static assert,
> as writefln()ing the offsetof also doesn't work..
> 
> DMD 0.129 on WinXP.

Added to DStress as http://dstress.kuehne.cn/run/o/offsetof_80_A.d http://dstress.kuehne.cn/run/o/offsetof_80_B.d http://dstress.kuehne.cn/run/o/offsetof_80_C.d http://dstress.kuehne.cn/run/o/offsetof_80_D.d http://dstress.kuehne.cn/run/o/offsetof_80_E.d http://dstress.kuehne.cn/run/o/offsetof_80_F.d

Thomas