-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. method parameter attributes was not generated
2. primary constructor properties
- Loading branch information
Showing
13 changed files
with
314 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,139 +1,88 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace AutoInterfaceSample.Test | ||
{ | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
//System.Diagnostics.Debug.WriteLine(BeaKona.Output.Debug_TestClass_1.Info); | ||
//IArbitrary<int> p = new Person(); | ||
//int f; | ||
//int g = 1; | ||
//p.Method(1, out f, ref g, "t", 1, 2, 3); | ||
|
||
IPrintable p = new MyPrinter(); | ||
//var c = p.Count; | ||
//Count = 3; | ||
p.Print(); | ||
//p.PrintComplex(); | ||
} | ||
} | ||
|
||
public interface IPrintable | ||
{ | ||
public void Print(); | ||
} | ||
|
||
public class SimplePrinter : IPrintable | ||
{ | ||
public void Print() { Console.WriteLine("OK"); } | ||
} | ||
|
||
public partial class MyPrinter : IPrintable | ||
public partial record TestRecord([property: BeaKona.AutoInterface] ILogger Logger) | ||
{ | ||
[BeaKona.AutoInterface] | ||
private readonly IPrintable _simplePrinter = new SimplePrinter(); | ||
} | ||
|
||
public partial class Person2 /*: IPrintableComplex*/ | ||
{ | ||
//[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true, MemberMatch = BeaKona.MemberMatchTypes.Public)] | ||
//private readonly SimplePrinter aspect1 = new SimplePrinter(); | ||
|
||
//[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true, MemberMatch = BeaKona.MemberMatchTypes.Explicit)] | ||
//private readonly SimplePrinter aspect2 = new SimplePrinter(); | ||
|
||
//[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true)] | ||
//private readonly SimplePrinter aspect3 = new SimplePrinter(); | ||
//[field: BeaKona.AutoInterface] | ||
//public ILogger Logger { get; } | ||
|
||
//[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true, MemberMatch = BeaKona.MemberMatchTypes.Any)] | ||
//private readonly SimplePrinter aspect4 = new SimplePrinter(); | ||
|
||
//void IPrintableComplex.PrintComplex() => Console.WriteLine("OKC2"); | ||
|
||
public void PrintComplex() { Console.WriteLine("Oh, K."); } | ||
//void IPrintableComplex.PrintComplex() { Console.WriteLine("Oh, K."); } | ||
} | ||
|
||
|
||
public class SignalPlotXYConst<TX, TY, T> where TX : struct, IComparable | ||
{ | ||
//[BeaKona.AutoInterface] | ||
//private readonly ILogger logger2 = new SimpleLogger(); | ||
} | ||
|
||
public interface ISome | ||
public sealed class LogEventProperty<T> | ||
{ | ||
} | ||
|
||
public interface ISome2 | ||
[AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.GenericParameter, AllowMultiple = true)] | ||
public class TestAttribute : Attribute | ||
{ | ||
} | ||
|
||
public struct Heatmap | ||
public sealed class SimpleLogger : ILogger | ||
{ | ||
} | ||
|
||
public class Colormap | ||
{ | ||
} | ||
|
||
public interface IArbitrary<T> | ||
{ | ||
T Length { get; } | ||
int? Method(int a, out int b, ref int c, dynamic d, params int[] p); | ||
|
||
SignalPlotXYConst<TXi, TYi?, T>? Method2<TXi, TYi>(TXi x, TYi[] ys, in int s) where TXi : struct, IComparable where TYi : struct, IComparable, ISome, ISome2; | ||
|
||
Heatmap AddHeatmap(double?[,] intensities, Colormap? colormap = null, bool? lockScales = true); | ||
Heatmap AddHeatmap(double[,] intensities, Colormap? colormap = null, bool? lockScales = null); | ||
} | ||
|
||
public class PrinterV1 | ||
{ | ||
public void Print() | ||
public bool BindProperty<[Test] T>(string? propertyName, object? value, bool destructureObjects, [NotNullWhen(true)] out LogEventProperty<T>? property, [Test] params int[] values) | ||
{ | ||
property = default; | ||
return false; | ||
} | ||
|
||
public int Length => 1; | ||
|
||
public int? Method(int a, out int b, ref int c, dynamic d, params int[] p) | ||
[Test] | ||
public int Count | ||
{ | ||
b = a; | ||
return a; | ||
[return: Test] | ||
[Test] | ||
get => 1; | ||
[return: Test] | ||
[Test] | ||
set | ||
{ | ||
} | ||
} | ||
|
||
public SignalPlotXYConst<TXc, TYc?, int>? Method2<TXc, TYc>(TXc x, TYc[] ys, in int s) where TXc : struct, IComparable where TYc : struct, IComparable, ISome, ISome2 | ||
public int Length | ||
{ | ||
return null; | ||
get => 1; | ||
set { } | ||
} | ||
} | ||
|
||
public Heatmap AddHeatmap(double?[,] intensities, Colormap? colormap = null, bool? lockScales = true) | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
return new Heatmap(); | ||
} | ||
//System.Diagnostics.Debug.WriteLine(BeaKona.Output.Debug_TestClass_1.Info); | ||
|
||
public Heatmap AddHeatmap(double[,] intensities, Colormap? colormap = null, bool? lockScales = null) | ||
{ | ||
return new Heatmap(); | ||
ILogger p = new TestRecord(new SimpleLogger()); | ||
var result = p.BindProperty<int>("test", 1, false, out var property, 1, 2, 3); | ||
} | ||
} | ||
|
||
public partial class Person | ||
public interface ILogger | ||
{ | ||
[BeaKona.AutoInterface(typeof(IArbitrary<int>), PreferCoalesce = true)] | ||
//[BeaKona.AutoInterface(typeof(ITestable))] | ||
//[BeaKona.AutoInterface(typeof(IPrintable), true)] | ||
//[BeaKona.AutoInterface(typeof(IPrintable), false)] | ||
//[BeaKona.AutoInterface(typeof(IPrintable))]//, TemplateBody = "void TestB1() {}" | ||
//[BeaKona.AutoInterface(typeof(IPrintable2))]//, TemplateBody = "void TestB2() {}" | ||
//[BeaKona.AutoInterfaceTemplate(BeaKona.AutoInterfaceTargets.PropertyGetter, Filter = "Length", Language = "scriban", Body = "return 1;")] | ||
//[BeaKona.AutoInterfaceTemplate(BeaKona.AutoInterfaceTargets.Method, Filter = "Print(\\d)?", Body = "LogDebug(nameof({{interface}}.{{name}})); {{expression}};")] | ||
private readonly PrinterV1? aspect1 = new PrinterV1(); | ||
[Test] | ||
[return: Test] | ||
[return: Test] | ||
bool BindProperty<[Test] T>(string? propertyName, object? value, bool destructureObjects, [NotNullWhen(true)] out LogEventProperty<T>? property, [Test] params int[] values); | ||
|
||
[Test] | ||
int Count | ||
{ | ||
[return: Test] | ||
[Test] | ||
get; | ||
[return: Test] | ||
[Test] | ||
set; | ||
} | ||
|
||
//[BeaKona.AutoInterface(typeof(IPrintable), IncludeBaseInterfaces = true)] | ||
//[BeaKona.AutoInterfaceTemplate(BeaKona.AutoInterfaceTargets.Method, Filter = "Print2", Body = "/* */")] | ||
//[BeaKona.AutoInterfaceTemplate(BeaKona.AutoInterfaceTargets.Method, Filter = "Print2", Body = "/* */")] | ||
//[BeaKona.AutoInterface(typeof(ITestable))] | ||
//private readonly PrinterV1? aspect2 = new PrinterV1(); | ||
int Length | ||
{ | ||
[return: Test] | ||
get; | ||
[return: Test] | ||
set; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.