Pass the paramerer name to ArgumentException constructor.
authorRodrigo Kumpera <kumpera@gmail.com>
Sun, 11 Dec 2011 21:25:31 +0000 (19:25 -0200)
committerRodrigo Kumpera <kumpera@gmail.com>
Sun, 11 Dec 2011 21:25:31 +0000 (19:25 -0200)
mcs/class/corlib/System/Tuples.cs

index 36ccd4190ddfbc3775f8d27243dfd638a061910d..6256a029ebb13006cb8507cca724a4577f752d1a 100644 (file)
@@ -57,7 +57,7 @@ namespace System
                                        ok = false;
                        }
                        if (!ok)
-                               throw new ArgumentException ("The last element of an eight element tuple must be a Tuple.");
+                               throw new ArgumentException ("rest", "The last element of an eight element tuple must be a Tuple.");
                }
        }
 
@@ -87,7 +87,7 @@ namespace System
                        var t = other as Tuple<T1>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        return comparer.Compare (item1, t.item1);
@@ -153,7 +153,7 @@ namespace System
                        var t = other as Tuple<T1, T2>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -230,7 +230,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -317,7 +317,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3, T4>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -414,7 +414,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3, T4, T5>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -521,7 +521,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3, T4, T5, T6>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -638,7 +638,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3, T4, T5, T6, T7>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -753,7 +753,7 @@ namespace System
                        var t = other as Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>;
                        if (t == null) {
                                if (other == null) return 1;
-                               throw new ArgumentException ();
+                               throw new ArgumentException ("other");
                        }
 
                        int res = comparer.Compare (item1, t.item1);
@@ -881,7 +881,7 @@ public class TupleGen
                        Console.WriteLine ("\t\t\tvar t = other as {0};", type_name);
                        Console.WriteLine ("\t\t\tif (t == null) {");
                        Console.WriteLine ("\t\t\t\tif (other == null) return 1;");
-                       Console.WriteLine ("\t\t\t\tthrow new ArgumentException ();");
+                       Console.WriteLine ("\t\t\t\tthrow new ArgumentException ("other");");
                        Console.WriteLine ("\t\t\t}");
                        Console.WriteLine ();