183 references to NullableFlowState
Microsoft.CodeAnalysis (10)
Symbols\ITypeSymbol.cs (4)
140
string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat? format = null);
149
ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat? format = null);
163
NullableFlowState
topLevelNullability,
179
NullableFlowState
topLevelNullability,
Symbols\NullabilityInfo.cs (2)
26
public
NullableFlowState
FlowState { get; }
28
internal NullabilityInfo(NullableAnnotation annotation,
NullableFlowState
flowState)
Symbols\NullableFlowState.cs (4)
30
/// This method directly converts a <see cref="
NullableFlowState
"/> to a <see cref="NullableAnnotation"/>,
35
public static NullableAnnotation ToAnnotation(this
NullableFlowState
nullableFlowState)
39
case CodeAnalysis.
NullableFlowState
.MaybeNull:
41
case CodeAnalysis.
NullableFlowState
.NotNull:
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
CodeGenerationTypeSymbol.cs (4)
64
public string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
67
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
70
public string ToMinimalDisplayString(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
73
public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
Microsoft.CodeAnalysis.CSharp (28)
BoundTree\BoundNode.cs (5)
242
case CodeAnalysis.
NullableFlowState
.MaybeNull:
246
case CodeAnalysis.
NullableFlowState
.NotNull:
277
var
flowState = (_attributes & BoundNodeAttributes.TopLevelFlowStateMaybeNull) == 0 ? CodeAnalysis.
NullableFlowState
.NotNull : CodeAnalysis.
NullableFlowState
.MaybeNull;
Compilation\CSharpSemanticModel.cs (2)
2121
convertedNullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.
NullableFlowState
.NotNull);
2249
nullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.
NullableFlowState
.NotNull);
SymbolDisplay\SymbolDisplay.cs (5)
40
CodeAnalysis.
NullableFlowState
nullableFlowState,
80
CodeAnalysis.
NullableFlowState
nullableFlowState,
123
CodeAnalysis.
NullableFlowState
nullableFlowState,
170
CodeAnalysis.
NullableFlowState
nullableFlowState,
193
CodeAnalysis.
NullableFlowState
nullableFlowState,
Symbols\NullableFlowStateExtensions.cs (8)
29
internal static CodeAnalysis.
NullableFlowState
ToPublicFlowState(this CSharp.NullableFlowState nullableFlowState) =>
32
CSharp.NullableFlowState.NotNull => CodeAnalysis.
NullableFlowState
.NotNull,
33
CSharp.NullableFlowState.MaybeNull => CodeAnalysis.
NullableFlowState
.MaybeNull,
34
CSharp.NullableFlowState.MaybeDefault => CodeAnalysis.
NullableFlowState
.MaybeNull,
39
public static CSharp.NullableFlowState ToInternalFlowState(this CodeAnalysis.
NullableFlowState
flowState) =>
42
CodeAnalysis.
NullableFlowState
.None => CSharp.NullableFlowState.NotNull,
43
CodeAnalysis.
NullableFlowState
.NotNull => CSharp.NullableFlowState.NotNull,
44
CodeAnalysis.
NullableFlowState
.MaybeNull => CSharp.NullableFlowState.MaybeNull,
Symbols\PublicModel\TypeSymbol.cs (4)
147
string ITypeSymbol.ToDisplayString(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format)
152
ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToDisplayParts(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format)
157
string ITypeSymbol.ToMinimalDisplayString(SemanticModel semanticModel, CodeAnalysis.
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format)
162
ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToMinimalDisplayParts(SemanticModel semanticModel, CodeAnalysis.
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format)
Symbols\TypeSymbol.cs (4)
661
public string ToDisplayString(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
666
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
673
CodeAnalysis.
NullableFlowState
topLevelNullability,
682
CodeAnalysis.
NullableFlowState
topLevelNullability,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
NullableHelpers.cs (1)
84
if (typeInfo.Nullability.FlowState ==
NullableFlowState
.MaybeNull)
Microsoft.CodeAnalysis.CSharp.Features (4)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
811
if (returnTypeInfo.Nullability.FlowState ==
NullableFlowState
.MaybeNull)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
78
protected override
NullableFlowState
GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
84
return
NullableFlowState
.None;
93
return
NullableFlowState
.None;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (42)
Semantics\NullableContextTests.cs (32)
353
var
expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.
NullableFlowState
.NotNull : Microsoft.CodeAnalysis.
NullableFlowState
.None;
392
var
expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull : Microsoft.CodeAnalysis.
NullableFlowState
.None;
427
var
expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull : Microsoft.CodeAnalysis.
NullableFlowState
.None;
1776
Assert.Equal(Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
1781
Assert.Equal(Microsoft.CodeAnalysis.
NullableFlowState
.None, typeInfo.Nullability.FlowState);
1804
verify(source, Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull, ".ctor");
1818
verify(source, Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull, ".ctor");
1832
verify(source, Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull, ".ctor");
1834
static void verify(string source, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState, params string[] expectedAnalyzedKeys)
1880
verify(attributeArguments[0], "A.F1 = null", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
1881
verify(attributeArguments[1], "A.F2 = null", Microsoft.CodeAnalysis.
NullableFlowState
.None);
1886
void verify(AttributeArgumentSyntax syntax, string expectedText, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState)
1929
verify(attributeArguments[0], "C1", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
1930
verify(attributeArguments[1], "C2", Microsoft.CodeAnalysis.
NullableFlowState
.None);
1941
void verify(AttributeArgumentSyntax syntax, string expectedText, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState)
1971
verify(equalsValueClauses[0], "(F1 = null)", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
1972
verify(equalsValueClauses[1], "(F2 = null)", Microsoft.CodeAnalysis.
NullableFlowState
.None);
1977
void verify(EqualsValueClauseSyntax syntax, string expectedText, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState)
2011
verify(declarations[0], "F1", Microsoft.CodeAnalysis.
NullableFlowState
.None);
2012
verify(declarations[1], "F2", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
2013
verify(declarations[2], "F3", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
2018
void verify(VariableDeclaratorSyntax syntax, string expectedText, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState)
2050
verify(declarations[0], "P1", Microsoft.CodeAnalysis.
NullableFlowState
.None);
2051
verify(declarations[1], "P2", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
2052
verify(declarations[2], "P3", Microsoft.CodeAnalysis.
NullableFlowState
.MaybeNull);
2057
void verify(PropertyDeclarationSyntax syntax, string expectedText, Microsoft.CodeAnalysis.
NullableFlowState
expectedFlowState)
Semantics\NullableReferenceTypesTests.cs (8)
53900
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
53930
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
53963
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState);
54000
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState);
54128
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
60398
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
156842
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
156888
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
Semantics\TopLevelStatementsTests.cs (2)
1511
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState);
1514
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (62)
Compilation\SemanticModelGetSemanticInfoTests.cs (4)
8557
Assert.Equal(CodeAnalysis.
NullableFlowState
.None, semanticInfo.Nullability.FlowState);
8558
Assert.Equal(CodeAnalysis.
NullableFlowState
.None, semanticInfo.ConvertedNullability.FlowState);
8602
Assert.Equal(CodeAnalysis.
NullableFlowState
.None, semanticInfo.Nullability.FlowState);
8603
Assert.Equal(CodeAnalysis.
NullableFlowState
.None, semanticInfo.ConvertedNullability.FlowState);
Compilation\TypeInfoTests.cs (2)
22
var notNullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.
NullableFlowState
.NotNull);
23
var nullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.
NullableFlowState
.MaybeNull);
Symbols\Source\NullablePublicAPITests.cs (56)
18
using PublicNullableFlowState = Microsoft.CodeAnalysis.
NullableFlowState
;
1096
Assert.Equal(
PublicNullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
1214
var nullable = new NullabilityInfo(PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
1215
var notNullable = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated,
PublicNullableFlowState
.NotNull);
1263
var notNull = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated,
PublicNullableFlowState
.NotNull);
1264
var @null = new NullabilityInfo(PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
1374
verifySpeculativeModel(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1377
verifySpeculativeModel(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1380
verifySpeculativeModel(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1383
verifySpeculativeModel(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1386
verifySpeculativeModel(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1389
verifySpeculativeModel(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1391
void verifySpeculativeModel(int spanStart,
PublicNullableFlowState
conditionFlowState)
1399
Assert.Equal(
PublicNullableFlowState
.NotNull, speculativeTypeInfo.Nullability.FlowState);
1402
Assert.Equal(
PublicNullableFlowState
.NotNull, referenceTypeInfo.Nullability.FlowState);
1404
Assert.Equal(
PublicNullableFlowState
.NotNull, coalesceTypeInfo.Nullability.FlowState);
1444
Assert.Equal(
PublicNullableFlowState
.NotNull, speculativeTypeInfo.Nullability.FlowState);
1518
verifySpeculativeTypeInfo(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1519
verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1521
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1522
verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1524
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1525
verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1527
void verifySpeculativeTypeInfo(int position,
PublicNullableFlowState
expectedFlowState)
1532
Assert.Equal(
PublicNullableFlowState
.NotNull, specTypeInfo.Nullability.FlowState);
1574
verifySpeculativeTypeInfo(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1575
verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1577
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1578
verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1580
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1581
verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1583
void verifySpeculativeTypeInfo(int position,
PublicNullableFlowState
expectedFlowState)
1588
Assert.Equal(
PublicNullableFlowState
.NotNull, specTypeInfo.Nullability.FlowState);
1628
Assert.Equal(
PublicNullableFlowState
.MaybeNull, type.Nullability.FlowState);
1674
Assert.Equal(
PublicNullableFlowState
.None, type.Nullability.FlowState);
1717
Assert.Equal(
PublicNullableFlowState
.None, type.Nullability.FlowState);
1797
Assert.Equal(
PublicNullableFlowState
.MaybeNull, info.Nullability.FlowState);
1954
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
1955
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.ConvertedNullability.FlowState);
2298
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2568
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2569
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.ConvertedNullability.FlowState);
2922
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2926
Assert.Equal(
PublicNullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
2931
Assert.Equal(
PublicNullableFlowState
.None, typeInfo.Nullability.FlowState);
4274
Assert.Equal(
PublicNullableFlowState
.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState);
4277
Assert.Equal(
PublicNullableFlowState
.NotNull, model.GetTypeInfo(default1).Nullability.FlowState);
4308
Assert.Equal(
PublicNullableFlowState
.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState);
4311
Assert.Equal(
PublicNullableFlowState
.NotNull, model.GetTypeInfo(default1).Nullability.FlowState);
4337
verify(exprs[0], PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
4338
verify(exprs[1], PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
4340
void verify(DefaultExpressionSyntax expr, PublicNullableAnnotation expectedAnnotation,
PublicNullableFlowState
expectedState)
4823
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4828
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4853
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4918
Assert.Equal(
PublicNullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
474
Assert.NotEqual(CodeAnalysis.
NullableFlowState
.None, typeInfo.Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
NullableHelpers.cs (1)
84
if (typeInfo.Nullability.FlowState ==
NullableFlowState
.MaybeNull)
Microsoft.CodeAnalysis.Features (16)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (4)
120
public string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
123
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
126
public string ToMinimalDisplayString(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
129
public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
QuickInfo\CommonSemanticQuickInfoProvider.cs (4)
182
protected virtual
NullableFlowState
GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) =>
NullableFlowState
.None;
208
var
nullableFlowState =
NullableFlowState
.None;
QuickInfo\CommonSemanticQuickInfoProvider.TokenInfo.cs (4)
22
/// The nullable flow state to show in Quick Info; will be <see cref="
NullableFlowState
.None"/> to show nothing.
24
public readonly
NullableFlowState
NullableFlowState;
26
public TokenInformation(ImmutableArray<ISymbol> symbols, bool showAwaitReturn = false,
NullableFlowState
nullableFlowState =
NullableFlowState
.None)
QuickInfo\QuickInfoUtilities.cs (4)
25
=> CreateQuickInfoItemAsync(services, semanticModel, span, symbols, supportedPlatforms: null, showAwaitReturn: false, flowState:
NullableFlowState
.None, options, cancellationToken);
34
NullableFlowState
flowState,
135
NullableFlowState
.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name),
136
NullableFlowState
.NotNull => string.Format(FeaturesResources._0_is_not_null_here, symbol.Name),
Microsoft.CodeAnalysis.UnitTests (6)
Symbols\NullabilityInfoTests.cs (6)
19
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated,
NullableFlowState
.NotNull),
20
new NullabilityInfo(NullableAnnotation.Annotated,
NullableFlowState
.NotNull),
23
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated,
NullableFlowState
.NotNull),
24
new NullabilityInfo(NullableAnnotation.NotAnnotated,
NullableFlowState
.NotNull),
27
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated,
NullableFlowState
.MaybeNull),
28
new NullabilityInfo(NullableAnnotation.Annotated,
NullableFlowState
.NotNull),
Microsoft.CodeAnalysis.VisualBasic (4)
Symbols\TypeSymbol.vb (4)
604
Private Function ITypeSymbol_ToDisplayString(topLevelNullability As
NullableFlowState
, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToDisplayString
608
Private Function ITypeSymbol_ToDisplayParts(topLevelNullability As
NullableFlowState
, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToDisplayParts
612
Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As
NullableFlowState
, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString
616
Private Function ITypeSymbol_ToMinimalDisplayParts(semanticModel As SemanticModel, topLevelNullability As
NullableFlowState
, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToMinimalDisplayParts
Microsoft.CodeAnalysis.Workspaces (4)
CodeGenerationTypeSymbol.cs (4)
64
public string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
67
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
70
public string ToMinimalDisplayString(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
73
public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)