[Mono-bugs] [Bug 74945][Nor] New - gmcs forgets to compile a generic method

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat May 14 06:05:17 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dsilva at ccs.neu.edu.

http://bugzilla.ximian.com/show_bug.cgi?id=74945

--- shadow/74945	2005-05-14 06:05:17.000000000 -0400
+++ shadow/74945.tmp.21931	2005-05-14 06:05:17.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 74945
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: dsilva at ccs.neu.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs forgets to compile a generic method
+
+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


More information about the mono-bugs mailing list