Add support for static properties and methods (#28)

* x

* Add support for static properties and methods.
This commit is contained in:
Stef Heyenrath
2022-02-02 09:01:51 +01:00
committed by GitHub
parent 76d8a2d5a5
commit 307bc1a015
11 changed files with 87 additions and 54 deletions
@@ -14,6 +14,8 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IPersonExtends
{
string StaticString { get; set; }
string Name { get; set; }
string? StringNullable { get; set; }
@@ -24,9 +26,9 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
bool IsAlive { get; set; }
bool X { get; set; }
string StaticMethod(int x, string y);
void Void();
@@ -13,10 +13,12 @@ using AutoMapper;
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public class PersonExtendsProxy : IPersonExtends
public partial class PersonExtendsProxy : IPersonExtends
{
public ProxyInterfaceSourceGeneratorTests.Source.PersonExtends _Instance { get; }
public string StaticString { get => ProxyInterfaceSourceGeneratorTests.Source.PersonExtends.StaticString; set => ProxyInterfaceSourceGeneratorTests.Source.PersonExtends.StaticString = value; }
public string Name { get => _Instance.Name; set => _Instance.Name = value; }
public string? StringNullable { get => _Instance.StringNullable; set => _Instance.StringNullable = value; }
@@ -27,9 +29,15 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public bool IsAlive { get => _Instance.IsAlive; set => _Instance.IsAlive = value; }
public bool X { get => _Instance.X; set => _Instance.X = value; }
public string StaticMethod(int x, string y)
{
int x_ = x;
string y_ = y;
var result_6851397 = ProxyInterfaceSourceGeneratorTests.Source.PersonExtends.StaticMethod(x_, y_);
return result_6851397;
}
public void Void()
{
@@ -39,8 +47,8 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public string HelloWorld(string name)
{
string name_ = name;
var result_58477331 = _Instance.HelloWorld(name_);
return result_58477331;
var result_6851397 = _Instance.HelloWorld(name_);
return result_6851397;
}
public void WithParams(params string[] values)
@@ -53,15 +61,15 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
string s_ = s;
string @string_ = @string;
var result_58477331 = _Instance.Add(s_, @string_);
return result_58477331;
var result_6851397 = _Instance.Add(s_, @string_);
return result_6851397;
}
public int DefaultValue(int x = 100)
{
int x_ = x;
var result_42930144 = _Instance.DefaultValue(x_);
return result_42930144;
var result_3873514 = _Instance.DefaultValue(x_);
return result_3873514;
}
public void In_Out_Ref1(in int a, out int b, ref int c)
@@ -78,26 +86,26 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
int x_ = x;
T1 t1_ = t1;
T2 t2_ = t2;
var result_38995950 = _Instance.Generic2<T1, T2>(x_, t1_, t2_);
return result_38995950;
var result_14331071 = _Instance.Generic2<T1, T2>(x_, t1_, t2_);
return result_14331071;
}
public System.Threading.Tasks.Task Method1Async()
{
var result_51708797 = _Instance.Method1Async();
return result_51708797;
var result_39535275 = _Instance.Method1Async();
return result_39535275;
}
public System.Threading.Tasks.Task<int> Method2Async()
{
var result_1620952573 = _Instance.Method2Async();
return result_1620952573;
var result_772784336 = _Instance.Method2Async();
return result_772784336;
}
public System.Threading.Tasks.Task<string?> Method3Async()
{
var result_1636499760 = _Instance.Method3Async();
return result_1636499760;
var result_769806453 = _Instance.Method3Async();
return result_769806453;
}
@@ -35,8 +35,8 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public string HelloWorld(string name)
{
string name_ = name;
var result_56365455 = _Instance.HelloWorld(name_);
return result_56365455;
var result_37309470 = _Instance.HelloWorld(name_);
return result_37309470;
}
public void WithParams(params string[] values)
@@ -49,15 +49,15 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
string s_ = s;
string @string_ = @string;
var result_56365455 = _Instance.Add(s_, @string_);
return result_56365455;
var result_37309470 = _Instance.Add(s_, @string_);
return result_37309470;
}
public int DefaultValue(int x = 100)
{
int x_ = x;
var result_39875940 = _Instance.DefaultValue(x_);
return result_39875940;
var result_24216618 = _Instance.DefaultValue(x_);
return result_24216618;
}
public void In_Out_Ref1(in int a, out int b, ref int c)
@@ -74,26 +74,26 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
int x_ = x;
T1 t1_ = t1;
T2 t2_ = t2;
var result_41799290 = _Instance.Generic2<T1, T2>(x_, t1_, t2_);
return result_41799290;
var result_60333940 = _Instance.Generic2<T1, T2>(x_, t1_, t2_);
return result_60333940;
}
public System.Threading.Tasks.Task Method1Async()
{
var result_32599313 = _Instance.Method1Async();
return result_32599313;
var result_2292327 = _Instance.Method1Async();
return result_2292327;
}
public System.Threading.Tasks.Task<int> Method2Async()
{
var result_1620495907 = _Instance.Method2Async();
return result_1620495907;
var result_1229624901 = _Instance.Method2Async();
return result_1229624901;
}
public System.Threading.Tasks.Task<string?> Method3Async()
{
var result_1604006392 = _Instance.Method3Async();
return result_1604006392;
var result_1242717753 = _Instance.Method3Async();
return result_1242717753;
}
@@ -108,6 +108,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
}
public bool IsAlive { get; set; }
}
}
#nullable disable