[Vala] Default Arguments to Functions
- From: tecywiz121 <tecywiz121 hotmail com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] Default Arguments to Functions
- Date: Mon, 07 Jun 2010 22:01:21 -0400
Hi there,
I think I may have found a bug in valac concerning default arguments to
functions.
I'm wondering if what I am doing is wrong, or whether its allowed.
Thanks,
Sam
The following code compiles into incorrect C:
void do_something(uint8[] array1,
uint8[] array2,
int len = int.min(array1.length, array2.length))
{
// Do something
}
int main(string[] args)
{
uint8[] a1 = new uint8[5];
uint8[] a2 = new uint8[6];
do_something(a1, a2);
return 0;
}
I get the following errors:
In function ‘_vala_main’:
error: ‘array1_length1’ undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
error: ‘array2_length1’ undeclared (first use in this function)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]