External Issue: Strange behaviour when returning array of arrays of uneven length in a tuple

18752, "rj-jesus", "Strange behaviour when returning array of arrays of uneven length in a tuple", "2021-11-19T19:07:04Z"

As per the title, it seems there's an error in Chapel when returning arrays of arrays of uneven length as members of tuples. For example, consider the code below

proc makeArray(n)
  return for i in 0..<n do i;

proc makeArrayOfArrays1(n)
  return for i in 0..<n do makeArray(i+1);

proc makeArrayOfArrays2(n)
  return (makeArrayOfArrays1(n), 0);

// this works and prints
// 0
// 0 1
// 0 1 2
// 0 1 2 3
// 0 1 2 3 4
// 0 1 2 3 4 5
// 0 1 2 3 4 5 6
// 0 1 2 3 4 5 6 7
// 0 1 2 3 4 5 6 7 8
// 0 1 2 3 4 5 6 7 8 9
var a = makeArrayOfArrays1(10);
for arr in a do writeln(arr);

// this doesn't work; it prints
// 0
// 0
// 0
// 0
// 0
// 0
// 0
// 0
// 0
// 0
var (b, _) = makeArrayOfArrays2(10);
for arr in b do writeln(arr);

I expected a and b to be absolutely equal, but it seems somehow b lost track of its inner dimensions. I assume this error only manifests with inner arrays of uneven length like above, but I haven't actually tested other cases.