Compilers can't always be expected to understand every kind of error, and that error message isn't the worst I've seen :) Still, if the opportunity os there to change it to something better, now harm done. The situation can be translated to this:
On 22 Apr 2009, at 17:17, Kassen wrote:
... I do think ChucK could come up with a better complaintI think ChucK can get pretty confused about this line:
x[msg.which] => int x;
...in which x is treated both as an array and as a newly declared integer
variable. I would rename the array to avoid confusion.
than this;
[unnamed1]:line(20): array subscripts (1) exceeds defined dimension (0)
With this test code it goes right;
int x[2];
int x;
And we get a rather appropriate
[unnamed1]:line(2): 'x' has already been defined in the same scope...
The problem is really that if I remove the second line of:
x[msg.which] => int x;x[msg.which] => int x0;then the firstis accepted.
x[msg.which] => int x;
So when I add the second line, I get a confusing error message about that, not about the first one, which seemed a legal name overload (though differing from C++).
Hans
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users