[Mono-bugs] [Bug 77136][Blo] Changed - Runtime cannot find method
(multiple generic parameter constraints)
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Jan 1 16:38:27 EST 2006
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 sestoft at dina.kvl.dk.
http://bugzilla.ximian.com/show_bug.cgi?id=77136
--- shadow/77136 2006-01-01 16:35:21.000000000 -0500
+++ shadow/77136.tmp.357 2006-01-01 16:38:27.000000000 -0500
@@ -1,14 +1,14 @@
Bug#: 77136
Product: Mono: Runtime
Version: 1.1
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Blocker
Component: JIT
AssignedTo: lupus at ximian.com
ReportedBy: sestoft at dina.kvl.dk
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
@@ -98,6 +98,47 @@
Additional Information:
The gmcs-generated exe runs fine on Microsoft .Net SDK 2005 final release.
The mono runtime crashes also on the csc-generated exe.
+
+------- Additional Comments From sestoft at dina.kvl.dk 2006-01-01 16:38 -------
+Here's the example program:
+
+using System;
+using System.Collections.Generic;
+
+struct ComparablePair<T,U> : IComparable<ComparablePair<T,U>>
+ where T : IComparable<T>
+ where U : IComparable<U> {
+ public readonly T Fst;
+ public readonly U Snd;
+
+ public ComparablePair(T fst, U snd) {
+ Fst = fst; Snd = snd;
+ }
+
+ // Lexicographic ordering
+ public int CompareTo(ComparablePair<T,U> that) {
+ int firstCmp = this.Fst.CompareTo(that.Fst);
+ return firstCmp != 0 ? firstCmp : this.Snd.CompareTo(that.Snd);
+ }
+
+ public override String ToString() {
+ return "(" + Fst + ", " + Snd + ")";
+ }
+}
+
+// Sorting soccer world champions by country and year
+
+class MyTest {
+ public static void Main(String[] args) {
+ List<ComparablePair<String,int>> lst
+ = new List<ComparablePair<String,int>>();
+ lst.Add(new ComparablePair<String,int>("Brazil", 2002));
+ lst.Add(new ComparablePair<String,int>("France", 1998));
+ lst.Sort();
+ foreach (ComparablePair<String,int> pair in lst)
+ Console.WriteLine(pair);
+ }
+}
More information about the mono-bugs
mailing list