Add support for indexers (#37)

* .

* .

* .

* ...

* .

* c

* p

* ok

* .
This commit is contained in:
Stef Heyenrath
2022-05-09 22:35:08 +02:00
committed by GitHub
parent ad2b22b008
commit 44213e91ab
11 changed files with 106 additions and 60 deletions
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@@ -7,6 +6,20 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
public class Person : Human
{
private readonly MyStruct[] _arr = new MyStruct[1];
public MyStruct this[int i]
{
get { return _arr[i]; }
set { _arr[i] = value; }
}
public MyStruct this[int i, string s]
{
get { return _arr[i]; }
set { _arr[i] = value; }
}
public IList<Human> AddHuman(Human h)
{
return new List<Human> { h, new Human { IsAlive = true } };
@@ -28,7 +41,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
return $"Hello {name} !";
}
public string HelloWorld2(string? name = "x")
{
return $"Hello {name} !";