Merge pull request #3662 from henricm/fix-windowsbase-on-win
[mono.git] / mcs / class / corlib / System / Array.cs
index 9c263400572cc9681d3fba5d8ad1ce6f5c579a1c..8f6e0aa098e40b238d2738503705207086c3eb80 100644 (file)
@@ -1689,10 +1689,10 @@ namespace System
                
                        if (keys == null)
                                throw new ArgumentNullException ("keys");
-                               
-                       if (keys.Length != items.Length)
-                               throw new ArgumentException ("Length of keys and items does not match.");
-                       
+
+                       if (keys.Length > items.Length)
+                               throw new ArgumentException ("Length of keys is larger than length of items.");
+
                        SortImpl<TKey, TValue> (keys, items, 0, keys.Length, comparer);
                }
 
@@ -3102,6 +3102,12 @@ namespace System
                        return d;
                }
 
+               [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+               public static T[] Empty<T>()
+               {
+                       return EmptyArray<T>.Value;
+               }
+
                public static bool Exists<T> (T [] array, Predicate <T> match)
                {
                        if (array == null)
@@ -3183,6 +3189,19 @@ namespace System
                //
                // Moved value from instance into target of different type with no checks (JIT intristics)
                //
+               // Restrictions:
+               //
+               // S and R must either:
+               //       both be blitable valuetypes
+               //       both be reference types (IOW, an unsafe cast)
+               // S and R cannot be float or double
+               // S and R must either:
+               //       both be a struct
+               //       both be a scalar
+               // S and R must either:
+               //       be of same size
+               //       both be a scalar of size <= 4
+               //
                internal static R UnsafeMov<S,R> (S instance) {
                        return (R)(object) instance;
                }