Beef
Beef copied to clipboard
[Enhancement] Support custom indexers in interfaces
Beef currently doesn't support custom indexers defined in interfaces, as shown below:
public interface IIndexable<T>
{
T this[int index] { get; set; }
}
public static void Get<T>(T indexable) where T : IIndexable<float>
{
// This fails!
float f = indexable[0];
}
The same functionality can be achieved using ref T Index(int index); in the interface, but a traditional indexer would probably be preferable to most users.