digitalmars.D.bugs - typedef-ed class field
- Mizuno Hiroki <hiroki1124 hotmail.com> May 16 2005
- David Medlock <noone nowhere.com> May 16 2005
- Mizuno Hiroki <hiroki1124 hotmail.com> May 16 2005
- Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> May 17 2005
I cannot access typedef-ed class field.
-------------------------------------------------
class Foo{
int i;
}
typedef Foo Bar;
void main(){
Bar bar = new Bar;
int n = bar.i; // this for i needs to be type
// Foo not type Bar
}
-------------------------------------------------
--
Mizuno Hiroki
May 16 2005
Mizuno Hiroki wrote:I cannot access typedef-ed class field. ------------------------------------------------- class Foo{ int i; } typedef Foo Bar; void main(){ Bar bar = new Bar; int n = bar.i; // this for i needs to be type // Foo not type Bar } ------------------------------------------------- -- Mizuno Hiroki
Use alias Foo Bar; -DavidM
May 16 2005
David Medlock wrote:Mizuno Hiroki wrote:I cannot access typedef-ed class field. ------------------------------------------------- class Foo{ int i; } typedef Foo Bar; void main(){ Bar bar = new Bar; int n = bar.i; // this for i needs to be type // Foo not type Bar } ------------------------------------------------- -- Mizuno Hiroki
Use alias Foo Bar; -DavidM
------------------------------------------------- class Foo{ ... } typedef Foo Bar1; typedef Foo Bar2; void f(Bar1 bar){...} void f(Bar2 bar){...} ------------------------------------------------- -- Mizuno Hiroki
May 16 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mizuno Hiroki schrieb am Mon, 16 May 2005 23:50:46 +0900:I cannot access typedef-ed class field. ------------------------------------------------- class Foo{ int i; } typedef Foo Bar; void main(){ Bar bar = new Bar; int n = bar.i; // this for i needs to be type // Foo not type Bar } -------------------------------------------------
Added to DStress as http://dstress.kuehne.cn/run/t/typedef_06_A.d http://dstress.kuehne.cn/run/t/typedef_06_B.d http://dstress.kuehne.cn/run/t/typedef_06_C.d http://dstress.kuehne.cn/run/t/typedef_07_A.d http://dstress.kuehne.cn/run/t/typedef_07_B.d http://dstress.kuehne.cn/run/t/typedef_07_C.d http://dstress.kuehne.cn/run/t/typedef_08_A.d http://dstress.kuehne.cn/run/t/typedef_08_B.d http://dstress.kuehne.cn/run/t/typedef_08_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCiipR3w+/yD4P9tIRApyQAJ9eRN/plePRvFYJkeWhd2nPGE4f1wCgzqlK Wqpu8M9NCZovmrXPHLcew2M= =iYXR -----END PGP SIGNATURE-----
May 17 2005









Mizuno Hiroki <hiroki1124 hotmail.com> 