Bug 317987 (MONO74945) - [GMCS] Runtime issue with `params T[][]'
Summary: [GMCS] Runtime issue with `params T[][]'
Status: RESOLVED FIXED
Alias: MONO74945
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-14 13:05 UTC by Daniel Silva
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:17:11 UTC


---- Reported by dsilva@ccs.neu.edu 2005-05-14 06:05:17 MST ----

Description of Problem:

gmcs isn't emitting the appendArrays<int> method here:


public class App {
  public static void Main() {
    FP.appendArrays(new int[] {1, 2}, new int[] {3, 4});
  }
}

class FP {
    public static T[] appendArrays<T>(params T[][] arrays) {
      int length = 0;
      foreach (T[] array in arrays)
        length += array.Length;
      T[] result = new T[length];
      int k = 0;
      foreach (T[] array in arrays)
        foreach (T obj in array) {
          result[k] = obj;
          k++;
        }
      return result;
    }
}

$ gmcs -g arr.cs
$ mono --debug arr.exe

** (arr.exe:6289): WARNING **: Missing method appendArrays in assembly
/tmp/arr.exe, type FP

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object



---- Additional Comments From martin@ximian.com 2005-05-17 10:29:43 MST ----

Very funny summary ;-)



---- Additional Comments From martin@ximian.com 2005-05-17 10:35:04 MST ----

I think we first have to fix #74953.



---- Additional Comments From martin@ximian.com 2005-07-06 14:04:05 MST ----

Fixed in SVN; added gtest-185.cs.

This bug depended on bug(s) 74953.

Unknown operating system unknown. Setting to default OS "Other".