Why is it that in TypeScript 1.8, the following code blocks with initializers are considered legal syntax:
class A
{
public textField: string;
}
var instanceOfClass = new A
{
textField = "HELLO WORLD"
};
var arrayCollection = new A[]
{
new A(), new A()
};
...but the following code block is not?
var arrayCollection = new A[]
{
new A
{
textField = "HELLO"
},
new A
{
textField = "WORLD"
}
};
It's interesting that TypeScript allows you to initialize arrays and objects, but does not support nesting object initializers within an array initializer.