Skip to content

Commit

Permalink
Move ThrowImmutableLength to the base class
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed May 18, 2024
1 parent eb4b6f9 commit 74779de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ protected Il2CppArrayBase(IntPtr pointer) : base(pointer)
public int Length => (int)IL2CPP.il2cpp_array_length(Pointer);

public abstract IEnumerator GetEnumerator();

private protected static bool ThrowImmutableLength()
{
throw new NotSupportedException("Arrays have immutable length");
}
}
public abstract class Il2CppArrayBase<T> : Il2CppArrayBase, IList<T>
{
Expand Down Expand Up @@ -96,11 +101,6 @@ protected static void StaticCtorBody(Type ownType)
Il2CppClassPointerStore<Il2CppArrayBase<T>>.CreatedTypeRedirect = ownType;
}

private static bool ThrowImmutableLength()
{
throw new NotSupportedException("Arrays have immutable length");
}

public static implicit operator T[](Il2CppArrayBase<T> il2CppArray)
{
if (il2CppArray == null)
Expand Down

0 comments on commit 74779de

Please sign in to comment.