annotate test/bug10.d @ 98:6789050b5ad1
trunk
[svn r102] Further delayed emission of function bodies to avoid problems with circular-forward-references.
Now uses the DMD _adEq(void[], void[], TypeInfo) runtime function for array equality comparison.
author |
lindquist |
date |
Wed, 14 Nov 2007 23:39:10 +0100 |
parents |
8b0e809563df |
children |
d9d5d59873d8 |
rev |
line source |
40
|
1 module bug10;
|
|
2 import std.stdio;
|
|
3 class C
|
|
4 {
|
|
5 char[] msg;
|
|
6
|
|
7 this()
|
|
8 {
|
|
9 }
|
|
10 this(char[] msg)
|
|
11 {
|
|
12 this.msg = msg;
|
|
13 }
|
|
14 }
|
|
15
|
|
16 void main()
|
|
17 {
|
|
18 auto c = new C();
|
|
19 c.msg = "world";
|
|
20 auto b = new C("hello");
|
|
21 printf("%.*s\n", b.msg.length, b.msg.ptr);
|
|
22 printf("%.*s\n", c.msg.length, c.msg.ptr);
|
|
23 }
|