-
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.
[fix] filter return attributes for Property
- Loading branch information
1 parent
e099142
commit f9b803f
Showing
3 changed files
with
57 additions
and
7 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
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,23 +1,52 @@ | ||
using TestInterfaces.A.B; | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace AutoInterfaceSample.Test | ||
{ | ||
public partial record TestRecord([property: BeaKona.AutoInterface(IncludeBaseInterfaces = true)] ITestable Testable) | ||
{ | ||
} | ||
public partial record TestRecord( | ||
[property: BeaKona.AutoInterface(IncludeBaseInterfaces = true)] NLog.ILogger nlog, | ||
[property: BeaKona.AutoInterface(IncludeBaseInterfaces = true)] Serilog.ILogger slog, | ||
[property: BeaKona.AutoInterface(IncludeBaseInterfaces = true)] Microsoft.Extensions.Logging.ILogger melog | ||
|
||
) : NLog.ILogger; | ||
|
||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
//System.Diagnostics.Debug.WriteLine(BeaKona.Output.Debug_TestRecord.Info); | ||
|
||
ITestable p = new TestRecord(new SimpleLogger()); | ||
// ITestable p = new TestRecord(new SimpleLogger()); | ||
|
||
p.Test(); | ||
// p.Test(); | ||
|
||
//p.Log<int?>(LogLevel.Debug, default, 1, null, null); | ||
//var result = p.BindProperty<int>("test", 1, false, out var property, 1, 2, 3); | ||
} | ||
} | ||
|
||
partial record TestObsoleteRecord( | ||
[property: BeaKona.AutoInterface(IncludeBaseInterfaces = true)] | ||
ITestInterfaceObsolete Testable) : ITestInterfaceObsolete; | ||
interface ITestInterfaceObsolete | ||
{ | ||
[Obsolete] | ||
[return: System.Diagnostics.CodeAnalysis.MaybeNull] | ||
[return: NotNullIfNotNullAttribute("test")] | ||
[return: TestReturnAttribute] | ||
ResObject? TestObsoleteMethod(string? test); | ||
|
||
[Obsolete] | ||
[System.Diagnostics.CodeAnalysis.DisallowNull] | ||
ResObject? TestObsoleteProperty { get; } | ||
|
||
|
||
} | ||
|
||
[Obsolete] | ||
|
||
class ResObject; | ||
|
||
[AttributeUsage(AttributeTargets.All)] | ||
class TestReturnAttribute : Attribute; | ||
} |
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