annotate run/typeid_01.d @ 538:5320be2851e8

fixed typeid checks for classes
author thomask
date Sat, 14 May 2005 06:46:25 +0000
parents f87ba6507260
children 7e8e5013a030
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
374
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
1 // $HeadURL$
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
2 // $Date$
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
3 // $Author$
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
4
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
5 module dstress.run.typeid_01;
f87ba6507260 added missing meta-data
thomask
parents: 18
diff changeset
6
2
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
7 class MyClass{
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
8 }
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
9
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
10 int main(){
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
11 TypeInfo ti = typeid(MyClass[]);
18
33a25c1e1cfc various corrections/by-passes of known problems
thomask
parents: 2
diff changeset
12 assert(!(ti is null));
538
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
13 assert(ti);
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
14 assert(ti.tsize==(MyClass[]).sizeof);
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
15 assert(ti.toString=="dstress.run.typeid_01.MyClass[]");
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
16
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
17 TypeInfo_Array ta = cast(TypeInfo_Array) ti;
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
18 assert(!(ta is null));
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
19 assert(ta);
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
20 assert(ta.tsize==(MyClass[]).sizeof);
5320be2851e8 fixed typeid checks for classes
thomask
parents: 374
diff changeset
21 assert(ta.toString=="dstress.run.typeid_01.MyClass[]");
2
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
22
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
23 return 0;
de27ca625bf7 extended abstract/alias and template tests
thomask
parents:
diff changeset
24 }