未验证 提交 d3305f28 编写于 作者: M Maksym Koshovyi 提交者: GitHub

Revisit PatternContext<TFrame>.PushDataFrame nullable annotation (#65598)

TFrame non null 
上级 2be87c9c
......@@ -247,14 +247,14 @@ public partial class PatternContextRaggedInclude : Microsoft.Extensions.FileSyst
public override void Declare(System.Action<Microsoft.Extensions.FileSystemGlobbing.Internal.IPathSegment, bool> onDeclare) { }
public override bool Test(Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase directory) { throw null; }
}
public abstract partial class PatternContext<TFrame> : Microsoft.Extensions.FileSystemGlobbing.Internal.IPatternContext
public abstract partial class PatternContext<TFrame> : Microsoft.Extensions.FileSystemGlobbing.Internal.IPatternContext where TFrame : struct
{
protected TFrame? Frame;
protected TFrame Frame;
protected PatternContext() { }
public virtual void Declare(System.Action<Microsoft.Extensions.FileSystemGlobbing.Internal.IPathSegment, bool> declare) { }
protected bool IsStackEmpty() { throw null; }
public virtual void PopDirectory() { }
protected void PushDataFrame(TFrame? frame) { }
protected void PushDataFrame(TFrame frame) { }
public abstract void PushDirectory(Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase directory);
public abstract bool Test(Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase directory);
public abstract Microsoft.Extensions.FileSystemGlobbing.Internal.PatternTestResult Test(Microsoft.Extensions.FileSystemGlobbing.Abstractions.FileInfoBase file);
......
......@@ -7,10 +7,10 @@
namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PatternContexts
{
public abstract class PatternContext<TFrame> : IPatternContext
public abstract class PatternContext<TFrame> : IPatternContext where TFrame : struct
{
private Stack<TFrame?> _stack = new();
protected TFrame? Frame;
private Stack<TFrame> _stack = new();
protected TFrame Frame;
public virtual void Declare(Action<IPathSegment, bool> declare) { }
......@@ -25,7 +25,7 @@ public virtual void PopDirectory()
Frame = _stack.Pop();
}
protected void PushDataFrame(TFrame? frame)
protected void PushDataFrame(TFrame frame)
{
_stack.Push(Frame);
Frame = frame;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册