diff --git a/BeefLibs/corlib/src/Collections/List.bf b/BeefLibs/corlib/src/Collections/List.bf index d099c08f..f9a3a1ed 100644 --- a/BeefLibs/corlib/src/Collections/List.bf +++ b/BeefLibs/corlib/src/Collections/List.bf @@ -289,7 +289,7 @@ namespace System.Collections /// Adds an item to the back of the list. public void Add(Span addSpan) { - if (mSize == AllocSize) + if (mSize + addSpan.Length > AllocSize) { let oldPtr = EnsureCapacity(mSize + addSpan.Length, false); for (var val in ref addSpan) diff --git a/BeefLibs/corlib/src/Span.bf b/BeefLibs/corlib/src/Span.bf index 8fea2ec3..e88e4c2d 100644 --- a/BeefLibs/corlib/src/Span.bf +++ b/BeefLibs/corlib/src/Span.bf @@ -184,6 +184,13 @@ namespace System return Enumerator(this); } + public override void ToString(String strBuffer) + { + strBuffer.Append("("); + typeof(T).GetFullName(strBuffer); + strBuffer.AppendF("*)0x{0:A}[{1}]", (uint)(void*)mPtr, mLength); + } + public struct Enumerator : IEnumerator, IRefEnumerator { private Span mList;