Mercurial > projects > ldc
annotate tests/mini/arrays8.d @ 1612:081c48283153
Merge DMD r278: bugzilla 370 Compiler stack overflow on recursive...
bugzilla 370 Compiler stack overflow on recursive typeof in function
declaration.
---
dmd/expression.c | 1 +
dmd/mtype.c | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:21 -0300 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
58
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
1 module arrays8; |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
2 |
175
c44e6a711885
[svn r191] Fixed: array literals did not support all type/storage combinations.
lindquist
parents:
58
diff
changeset
|
3 extern(C) int printf(char*, ...); |
c44e6a711885
[svn r191] Fixed: array literals did not support all type/storage combinations.
lindquist
parents:
58
diff
changeset
|
4 |
58
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
5 void main() |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
6 { |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
7 char[] a = "hello "; |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
8 printf(" \"%s\".length = %u\n", a.ptr, a.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
9 char[] b = "world"; |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
10 printf(" \"%s\".length = %u\n", b.ptr, b.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
11 char[] c = a ~ b; |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
12 printf("After 'a ~ b':\n"); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
13 printf(" \"%.*s\".length = %u\n", a.length, a.ptr, a.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
14 printf(" \"%.*s\".length = %u\n", b.length, b.ptr, b.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
15 printf(" \"%.*s\".length = %u\n", c.length, c.ptr, c.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
16 assert(c.length == a.length + b.length); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
17 assert(c !is a); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
18 assert(c !is b); |
2c3cd3596187
[svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff
changeset
|
19 } |