GNOME Bugzilla – Bug 537032
Name conflict in generated code for array with name "result"
Last modified: 2008-11-12 20:48:11 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:
Confirming.
Dupe of 469335?
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 ***