コード例 #1
0
 protected override BoundNode RewriteNullableBoundNodes(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics)
 {
     // https://github.com/dotnet/roslyn/issues/35037: Speculative models are going to have to do something more advanced
     // here. They will need to run nullable analysis up to the point that is being speculated on, and
     // then take that state and run analysis on the statement or expression being speculated on.
     // Currently, it will return incorrect info because it's just running analysis on the speculated
     // part.
     return(NullableWalker.AnalyzeAndRewrite(Compilation, MemberSymbol as MethodSymbol, boundRoot, binder, diagnostics));
 }
コード例 #2
0
 protected override BoundNode RewriteNullableBoundNodesWithSnapshots(
     BoundNode boundRoot,
     Binder binder,
     DiagnosticBag diagnostics,
     bool createSnapshots,
     out NullableWalker.SnapshotManager?snapshotManager,
     ref ImmutableDictionary <Symbol, Symbol>?remappedSymbols)
 {
     return(NullableWalker.AnalyzeAndRewrite(Compilation, symbol: null, boundRoot, binder, initialState: null, diagnostics, createSnapshots, out snapshotManager, ref remappedSymbols));
 }
 protected override BoundNode RewriteNullableBoundNodesWithSnapshots(
     BoundNode boundRoot,
     Binder binder,
     DiagnosticBag diagnostics,
     bool createSnapshots,
     out NullableWalker.SnapshotManager snapshotManager,
     ref ImmutableDictionary <Symbol, Symbol> remappedSymbols)
 {
     Debug.Assert(boundRoot.Syntax is TypeSyntax);
     return(NullableWalker.AnalyzeAndRewrite(Compilation, MemberSymbol as MethodSymbol, boundRoot, binder, initialState: null, diagnostics, createSnapshots: false, out snapshotManager, ref remappedSymbols));
 }
コード例 #4
0
 protected override BoundNode RewriteNullableBoundNodesWithSnapshots(
     BoundNode boundRoot,
     Binder binder,
     DiagnosticBag diagnostics,
     bool createSnapshots,
     out NullableWalker.SnapshotManager snapshotManager,
     ref ImmutableDictionary <Symbol, Symbol> remappedSymbols)
 {
     // https://github.com/dotnet/roslyn/issues/46424
     // Bind and analyze preceding field initializers in order to give an accurate initial nullable state.
     return(NullableWalker.AnalyzeAndRewrite(Compilation, MemberSymbol, boundRoot, binder, initialState: null, diagnostics, createSnapshots, out snapshotManager, ref remappedSymbols));
 }
コード例 #5
0
 protected override void AnalyzeBoundNodeNullability(
     BoundNode boundRoot,
     Binder binder,
     DiagnosticBag diagnostics,
     bool createSnapshots
     )
 {
     NullableWalker.AnalyzeWithoutRewrite(
         Compilation,
         MemberSymbol,
         boundRoot,
         binder,
         diagnostics,
         createSnapshots
         );
 }
コード例 #6
0
 protected override BoundNode RewriteNullableBoundNodes(BoundNode boundRoot, Conversions conversions, DiagnosticBag diagnostics)
 {
     return(NullableWalker.AnalyzeAndRewrite(Compilation, symbol: null, boundRoot, conversions, diagnostics));
 }
コード例 #7
0
 public static PossiblyConditionalState Create(NullableWalker nullableWalker)
 {
     return(nullableWalker.IsConditionalState
         ? new PossiblyConditionalState(nullableWalker.StateWhenTrue, nullableWalker.StateWhenFalse)
         : new PossiblyConditionalState(nullableWalker.State));
 }
 protected override BoundNode RewriteNullableBoundNodesWithSnapshots(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots, out NullableWalker.SnapshotManager snapshotManager)
 {
     Debug.Assert(boundRoot.Syntax is TypeSyntax);
     return(NullableWalker.AnalyzeAndRewrite(Compilation, MemberSymbol as MethodSymbol, boundRoot, binder, diagnostics, createSnapshots: false, out snapshotManager));
 }
コード例 #9
0
 protected override BoundNode RewriteNullableBoundNodesWithSnapshots(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics, bool createSnapshots, out NullableWalker.SnapshotManager snapshotManager)
 {
     return(NullableWalker.AnalyzeAndRewrite(Compilation, symbol: null, boundRoot, binder, diagnostics, createSnapshots, out snapshotManager));
 }
コード例 #10
0
 protected override BoundNode RewriteNullableBoundNodes(BoundNode boundRoot, Binder binder, DiagnosticBag diagnostics)
 {
     return(NullableWalker.AnalyzeAndRewrite(Compilation, MemberSymbol, boundRoot, binder, diagnostics));
 }