After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 537032 - Name conflict in generated code for array with name "result"
Name conflict in generated code for array with name "result"
Status: RESOLVED DUPLICATE of bug 469335
Product: vala
Classification: Core
Component: Arrays
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-06 20:34 UTC by Vassily Gavrilyak
Modified: 2008-11-12 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vassily Gavrilyak 2008-06-06 20:34:56 UTC
Please describe the problem:
When functions return array, and there is local variable with name "result" in function then there two declarations of result_length1 in generated code.
First declaration for returned array length (in function parameters) and second in function body for length of variable "result".
Changing variable name from "result" to "res" fixes the problem

Steps to reproduce:
class TestResult{
  int[] doubleArray(int[] arr){
    int[] result = new int[arr.length];
    for(int i=0; i<arr.length; i++)
      result[i] = arr[i]+arr[i];
    return result;
  }
  
  int main(string[] args){
     int[] arr = {1,2,3};
     int[] doubled = doubleArray(arr);
     return 0;
  }
}


Actual results:


Expected results:


Does this happen every time?
yes

Other information:
Comment 1 Jürg Billeter 2008-06-15 20:41:07 UTC
Confirming.
Comment 2 Jared Moore 2008-07-15 14:38:50 UTC
Dupe of 469335?
Comment 3 Jürg Billeter 2008-10-09 21:31:02 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 469335 ***