Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libraries/System.Private.CoreLib/src/System/Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public Span<T> Span
{
// Special-case string since it's the most common for ROM<char>.

refToReturn = ref Unsafe.As<char, T>(ref Unsafe.As<string>(tmpObject).GetRawStringData());
refToReturn = ref Unsafe.As<char, T>(ref ((string)tmpObject).GetRawStringData());
lengthOfUnderlyingSpan = Unsafe.As<string>(tmpObject).Length;
}
else if (RuntimeHelpers.ObjectHasComponentSize(tmpObject))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public ReadOnlySpan<T> Span
{
// Special-case string since it's the most common for ROM<char>.

refToReturn = ref Unsafe.As<char, T>(ref Unsafe.As<string>(tmpObject).GetRawStringData());
refToReturn = ref Unsafe.As<char, T>(ref ((string)tmpObject).GetRawStringData());
lengthOfUnderlyingSpan = Unsafe.As<string>(tmpObject).Length;
}
else if (RuntimeHelpers.ObjectHasComponentSize(tmpObject))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public readonly bool TryGetChild(char c, out int index)

if (children.GetType() == typeof(int[]))
{
int[] table = Unsafe.As<int[]>(children);
int[] table = (int[])children;
if (c < (uint)table.Length)
{
index = table[c];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ private static string JoinCore<T>(ReadOnlySpan<char> separator, IEnumerable<T> v
{
if (values.GetType() == typeof(List<string?>)) // avoid accidentally bypassing a derived type's reimplementation of IEnumerable<T>
{
return JoinCore(separator, CollectionsMarshal.AsSpan(Unsafe.As<List<string?>>(values)));
return JoinCore(separator, CollectionsMarshal.AsSpan((List<string?>)values));
}

if (values is string?[] valuesArray)
Expand Down
Loading