summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Tuple.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Tuple.cs')
-rw-r--r--src/mscorlib/src/System/Tuple.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mscorlib/src/System/Tuple.cs b/src/mscorlib/src/System/Tuple.cs
index 99164bc654..037b2ceee8 100644
--- a/src/mscorlib/src/System/Tuple.cs
+++ b/src/mscorlib/src/System/Tuple.cs
@@ -5,8 +5,13 @@ using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Diagnostics.Contracts;
+//
+// Note: F# compiler depends on the exact tuple hashing algorithm. Do not ever change it.
+//
+
namespace System {
/// <summary>
@@ -119,7 +124,7 @@ namespace System {
Tuple<T1> objTuple = other as Tuple<T1>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
return comparer.Compare(m_Item1, objTuple.m_Item1);
@@ -195,7 +200,7 @@ namespace System {
Tuple<T1, T2> objTuple = other as Tuple<T1, T2>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -282,7 +287,7 @@ namespace System {
Tuple<T1, T2, T3> objTuple = other as Tuple<T1, T2, T3>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -378,7 +383,7 @@ namespace System {
Tuple<T1, T2, T3, T4> objTuple = other as Tuple<T1, T2, T3, T4>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -483,7 +488,7 @@ namespace System {
Tuple<T1, T2, T3, T4, T5> objTuple = other as Tuple<T1, T2, T3, T4, T5>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -597,7 +602,7 @@ namespace System {
Tuple<T1, T2, T3, T4, T5, T6> objTuple = other as Tuple<T1, T2, T3, T4, T5, T6>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -720,7 +725,7 @@ namespace System {
Tuple<T1, T2, T3, T4, T5, T6, T7> objTuple = other as Tuple<T1, T2, T3, T4, T5, T6, T7>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -856,7 +861,7 @@ namespace System {
Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> objTuple = other as Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>;
if (objTuple == null) {
- throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other");
+ throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), nameof(other));
}
int c = 0;
@@ -919,7 +924,7 @@ namespace System {
case 7:
return Tuple.CombineHashCodes(comparer.GetHashCode(m_Item1), comparer.GetHashCode(m_Item2), comparer.GetHashCode(m_Item3), comparer.GetHashCode(m_Item4), comparer.GetHashCode(m_Item5), comparer.GetHashCode(m_Item6), comparer.GetHashCode(m_Item7), t.GetHashCode(comparer));
}
- Contract.Assert(false, "Missed all cases for computing Tuple hash code");
+ Debug.Assert(false, "Missed all cases for computing Tuple hash code");
return -1;
}