Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Update UWP package to latest. Change symchk errors to warnings. Chang…
Browse files Browse the repository at this point in the history
…e ReadOnlySpan indexer to return ref readonly. Related to https://github.com/dotnet/corefx/issues/24105 / dotnet/coreclr#14727.

[tfs-changeset: 1683794]
  • Loading branch information
dotnet-bot committed Dec 14, 2017

Verified

This commit was signed with the committer’s verified signature.
1 parent bb055ed commit 6566098
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/System.Private.CoreLib/shared/System/ReadOnlySpan.cs
Original file line number Diff line number Diff line change
@@ -165,15 +165,18 @@ public bool IsEmpty
/// <exception cref="System.IndexOutOfRangeException">
/// Thrown when index less than 0 or index greater than or equal to Length
/// </exception>
public T this[int index]
{
#if PROJECTN
public ref readonly T this[int index]
{
[BoundsChecking]
get
{
return Unsafe.Add(ref _pointer.Value, index);
return ref Unsafe.Add(ref _pointer.Value, index);
}
}
#else
public T this[int index]
{
[Intrinsic]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[NonVersionable]
@@ -183,8 +186,8 @@ public T this[int index]
ThrowHelper.ThrowIndexOutOfRangeException();
return Unsafe.Add(ref _pointer.Value, index);
}
#endif
}
#endif

/// <summary>
/// Copies the contents of this read-only span into destination span. If the source

0 comments on commit 6566098

Please sign in to comment.