[Enhancement] Generic Indexer
I noticed that the following code doesn't work in Beef:
uint32 i = 0;
char8[] array = default;
array[i].ToString(.. scope .()); // ERROR: Unable to implicitly cast 'uint' to 'System.IndexRange'
List<char8> list = default;
list[i].ToString(.. scope .()); // ERROR: Unable to implicitly cast 'uint' to 'System.IndexRange'
char8* charPtr = default;
charPtr[i].ToString(.. scope .()); // Ok
But it should work since both array and List<T> just end up calling the pointer indexer, which works fine with uint32, but it currently doesn't work because the indexers take an int parameter and uint isn't implicitly convertible to int.
This issue could be easily solved with a generic indexer using the constraint IInteger but currently Beef doesn't support generic indexers, so that's why I'm suggesting this feature.
Note that you also cannot index with uint in C#...
The opposite is true in C++- a std::vector takes a size_t indexer, so if you try to index with an intptr_t then you get warning C4365: 'argument': conversion from 'intptr_t' to 'const unsigned __int64', signed/unsigned mismatch if your warning level is turned up.
This code compiles just fine in C#:
uint i = 0;
char[] array = new char[2];
array[i].ToString();
But, you're partially right since List isn't indexable with uint in C#...