[Bug 135] New: typeof(x)() doesn't compile
Thomas Kuehne
thomas-dloop at kuehne.cn
Thu Jun 29 06:35:35 PDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at puremagic.com schrieb am 2006-05-11:
> http://d.puremagic.com/bugzilla/show_bug.cgi?id=135
> struct X { static void opCall() {} }
>
> X x;
> typeof(x)(); // Error: found '(' when expecting '.' following 'typeof(x)'
>
> Workarounds:
>
> 1. typeof(x).opCall();
> 2. template T(_T) { alias _T T; } T!(typeof(x))();
> 3. template mytypeof(alias x) { alias typeof(x) mytypeof; } mytypeof!(x)(); //
> For globally/statically declared X.
Added to DStress as
http://dstress.kuehne.cn/run/o/opCall_01_A.d
http://dstress.kuehne.cn/run/o/opCall_01_B.d
http://dstress.kuehne.cn/run/o/opCall_01_C.d
http://dstress.kuehne.cn/run/o/opCall_01_D.d
http://dstress.kuehne.cn/run/o/opCall_01_E.d
http://dstress.kuehne.cn/run/o/opCall_02_A.d
http://dstress.kuehne.cn/run/o/opCall_02_B.d
http://dstress.kuehne.cn/run/o/opCall_02_C.d
http://dstress.kuehne.cn/run/o/opCall_02_D.d
http://dstress.kuehne.cn/run/o/opCall_02_E.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFEolu/3w+/yD4P9tIRAvDzAKCuD/QjAstK4mySw6Zsr+OuBlWrSQCgtG5H
CFLO1H8pjNbwnnka1NGh8Wk=
=hW9g
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list