On 9/9/11, Walter Bright <[email protected]> wrote:
> On 9/9/2011 11:48 AM, bearophile wrote:
>> It seems Pull 375 also turns this program in a compile-time error:
>>
>> int[3] arr = [1, 2];
>> void main() {}
>>
>> Walter told me that this code used to work as designed, this means it's
>> not a bug.
>> Despite not being a bug, I think accepting that kind of code is a
>> bug-prone anti-feature.
>
> The point of that working is that it isn't unusual to have a large array
> with
> only the front of it initialized.
>

Some consistency would be good then:

int[3] arr = [1, 2];  // ok
void main()
{
    int[3] arr2 = [1, 2];  // fails at runtime
}

Reply via email to