1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 14:54:09 +02:00

Fixed indexer method selection

This commit is contained in:
Brian Fiete 2022-06-08 10:57:30 -07:00
parent 29832cb3bb
commit 35a81b7bbe
2 changed files with 45 additions and 35 deletions

View file

@ -76,6 +76,17 @@ namespace Tests
}
}
class Foo
{
public virtual int this[int i] => i;
}
class Bar : Foo
{
public override int this[int i] => i*i;
public Span<int> this[Range r] => default;
}
[Test]
public static void TestBasics()
{
@ -102,6 +113,9 @@ namespace Tests
int a = sa[3, 4, 5];
Test.Assert(a == 12);
Test.Assert(sa.mA == 9024);
Bar bar = scope .();
Test.Assert(bar[3] == 9);
}
}
}