D-Programming-Language/dmd — pull request #3615 by 9rnsr (2014-06-03 06:24:57+00:00)
Title: Issue 481 - Letting compiler determine length for fixed-length arrays

https://issues.dlang.org/show_bug.cgi?id=481

Add syntax support for partially typed variable declaration.

```d
void main()
{
// static array type
int[$] a1 = [1,2]; // int[2]
auto[$] a2 = [3,4,5]; // int[3]
const[$] a3 = [6,7,8]; // const(int[3])

// dynamic array type
immutable[] a4 = [1,2]; // immutable(int)[]
shared[] a5 = [3,4,5]; // shared(int)[]
// partially specified part is unqualified.

// pointer type
auto* p1 = new int(3); // int*
const* p2 = new int(3); // const(int)*

// mixing
auto[][$] x1 = [[1,2,3],[4,5]]; // int[][2]
shared*[$] x2 = [new int(1), new int(2)]; // shared(int)*[2]
}
```