diff --git a/src/mscorlib/shared/System/Numerics/Vector.cs b/src/mscorlib/shared/System/Numerics/Vector.cs index 9fbafbb16873..b9d72c898fa9 100644 --- a/src/mscorlib/shared/System/Numerics/Vector.cs +++ b/src/mscorlib/shared/System/Numerics/Vector.cs @@ -390,7 +390,7 @@ public unsafe Vector(T[] values, int index) } if (index < 0 || (values.Length - index) < Count) { - throw new IndexOutOfRangeException(); + throw new IndexOutOfRangeException(SR.Format(SR.Arg_InsufficientNumberOfElements, Vector.Count, nameof(values))); } if (Vector.IsHardwareAccelerated) @@ -771,7 +771,6 @@ private Vector(ref Register existingRegister) /// /// Constructs a vector from the given span. The span must contain at least Vector'T.Count elements. /// - [Intrinsic] public unsafe Vector(Span values) : this() { diff --git a/src/mscorlib/shared/System/Numerics/Vector.tt b/src/mscorlib/shared/System/Numerics/Vector.tt index 4a3a5b24ab0f..1f3798fbc194 100644 --- a/src/mscorlib/shared/System/Numerics/Vector.tt +++ b/src/mscorlib/shared/System/Numerics/Vector.tt @@ -202,7 +202,7 @@ namespace System.Numerics } if (index < 0 || (values.Length - index) < Count) { - throw new IndexOutOfRangeException(); + throw new IndexOutOfRangeException(SR.Format(SR.Arg_InsufficientNumberOfElements, Vector.Count, nameof(values))); } if (Vector.IsHardwareAccelerated) @@ -291,7 +291,6 @@ namespace System.Numerics /// /// Constructs a vector from the given span. The span must contain at least Vector'T.Count elements. /// - [Intrinsic] public unsafe Vector(Span values) : this() {