286 references to NullableFlowState
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
StaticRouteHandlerModel\Emitters\EndpointJsonPreparationEmitter.cs (1)
19
codeWriter.WriteLine($"var responseJsonTypeInfo = (JsonTypeInfo<{responseType.ToDisplayString(
NullableFlowState
.MaybeNull, EmitterConstants.DisplayFormat)}>)jsonSerializerOptions.GetTypeInfo(typeof({typeName}));");
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (2)
41
return type.ToDisplayString(isOptional ?
NullableFlowState
.MaybeNull :
NullableFlowState
.NotNull, EmitterConstants.DisplayFormat);
Microsoft.CodeAnalysis (10)
Symbols\ITypeSymbol.cs (4)
144
string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat? format = null);
153
ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat? format = null);
167
NullableFlowState
topLevelNullability,
183
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)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (4)
58
public string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
61
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
64
public string ToMinimalDisplayString(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
67
public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
Microsoft.CodeAnalysis.CSharp (28)
BoundTree\BoundNode.cs (5)
255
case CodeAnalysis.
NullableFlowState
.MaybeNull:
259
case CodeAnalysis.
NullableFlowState
.NotNull:
290
var
flowState = (_attributes & BoundNodeAttributes.TopLevelFlowStateMaybeNull) == 0 ? CodeAnalysis.
NullableFlowState
.NotNull : CodeAnalysis.
NullableFlowState
.MaybeNull;
Compilation\CSharpSemanticModel.cs (2)
2100
convertedNullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.
NullableFlowState
.NotNull);
2251
nullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.
NullableFlowState
.NotNull);
SymbolDisplay\SymbolDisplay.cs (5)
42
CodeAnalysis.
NullableFlowState
nullableFlowState,
104
CodeAnalysis.
NullableFlowState
nullableFlowState,
149
CodeAnalysis.
NullableFlowState
nullableFlowState,
196
CodeAnalysis.
NullableFlowState
nullableFlowState,
219
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)
663
public string ToDisplayString(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
668
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(CodeAnalysis.
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
675
CodeAnalysis.
NullableFlowState
topLevelNullability,
684
CodeAnalysis.
NullableFlowState
topLevelNullability,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
84
if (typeInfo.Nullability.FlowState ==
NullableFlowState
.MaybeNull)
Microsoft.CodeAnalysis.CSharp.Features (4)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
760
if (returnTypeInfo.Nullability.FlowState ==
NullableFlowState
.MaybeNull)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
86
protected override
NullableFlowState
GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken)
92
return
NullableFlowState
.None;
101
return
NullableFlowState
.None;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (142)
Semantics\DynamicTests.cs (66)
4983
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
5064
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
5107
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
5187
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
5230
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
5311
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6029
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6109
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6152
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6232
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6272
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6352
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6678
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6741
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
6787
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6850
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
6897
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
6961
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
7066
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7123
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
7169
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7235
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7282
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7351
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7398
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7468
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7588
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7647
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7693
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7753
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7799
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7859
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
7903
Assert.Equal(CodeAnalysis.
NullableFlowState
.None, typeInfo.Nullability.FlowState);
7974
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8034
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8080
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8140
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8185
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8244
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8290
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8353
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
8399
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8462
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
8508
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8571
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
8618
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
8682
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
8868
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10020
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10097
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10148
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10225
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10276
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10353
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10430
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10505
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10564
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10652
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10712
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10802
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
10982
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
11068
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
11324
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
11377
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
11591
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
11643
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
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 (42)
56080
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
56110
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
56143
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState);
56180
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState);
56308
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
62846
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
126835
private static readonly
NullableFlowState
[] s_AllNullableFlowStates = (
NullableFlowState
[])Enum.GetValues(typeof(
NullableFlowState
));
126856
var inputs = new[] {
NullableFlowState
.NotNull,
NullableFlowState
.MaybeNull };
126858
Func<int, int,
NullableFlowState
> getResult = (i, j) => inputs[i].Join(inputs[j]);
126860
var expected = new
NullableFlowState
[2, 2]
126862
{
NullableFlowState
.NotNull,
NullableFlowState
.MaybeNull },
126863
{
NullableFlowState
.MaybeNull,
NullableFlowState
.MaybeNull },
126888
var inputs = new[] {
NullableFlowState
.NotNull,
NullableFlowState
.MaybeNull };
126889
Func<int, int,
NullableFlowState
> getResult = (i, j) => inputs[i].Meet(inputs[j]);
126891
var expected = new
NullableFlowState
[2, 2]
126893
{
NullableFlowState
.NotNull,
NullableFlowState
.NotNull },
126894
{
NullableFlowState
.NotNull,
NullableFlowState
.MaybeNull },
126921
private static void AssertEqual(
NullableFlowState
[,] expected, Func<int, int,
NullableFlowState
> getResult, int size)
126923
AssertEx.Equal<
NullableFlowState
>(expected, getResult, (na1, na2) => na1 == na2, na => $"NullableFlowState.{na}", "{0,-32:G}", size);
126942
foreach (
var
a in s_AllNullableFlowStates)
126944
foreach (
var
b in s_AllNullableFlowStates)
126972
foreach (
var
a in s_AllNullableFlowStates)
126974
foreach (
var
b in s_AllNullableFlowStates)
126976
foreach (
var
c in s_AllNullableFlowStates)
127006
foreach (
var
a in s_AllNullableFlowStates)
127008
foreach (
var
b in s_AllNullableFlowStates)
127010
foreach (
var
c in s_AllNullableFlowStates)
127059
foreach (
var
a in s_AllNullableFlowStates)
127061
foreach (
var
b in s_AllNullableFlowStates)
127087
foreach (
var
a in s_AllNullableFlowStates)
127089
foreach (
var
b in s_AllNullableFlowStates)
161253
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
161299
Assert.Equal(CodeAnalysis.
NullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
Semantics\TopLevelStatementsTests.cs (2)
1523
Assert.Equal(CodeAnalysis.
NullableFlowState
.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState);
1526
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)
20
using PublicNullableFlowState = Microsoft.CodeAnalysis.
NullableFlowState
;
1098
Assert.Equal(
PublicNullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
1216
var nullable = new NullabilityInfo(PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
1217
var notNullable = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated,
PublicNullableFlowState
.NotNull);
1265
var notNull = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated,
PublicNullableFlowState
.NotNull);
1266
var @null = new NullabilityInfo(PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
1376
verifySpeculativeModel(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1379
verifySpeculativeModel(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1382
verifySpeculativeModel(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1385
verifySpeculativeModel(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1388
verifySpeculativeModel(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1391
verifySpeculativeModel(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1393
void verifySpeculativeModel(int spanStart,
PublicNullableFlowState
conditionFlowState)
1401
Assert.Equal(
PublicNullableFlowState
.NotNull, speculativeTypeInfo.Nullability.FlowState);
1404
Assert.Equal(
PublicNullableFlowState
.NotNull, referenceTypeInfo.Nullability.FlowState);
1406
Assert.Equal(
PublicNullableFlowState
.NotNull, coalesceTypeInfo.Nullability.FlowState);
1446
Assert.Equal(
PublicNullableFlowState
.NotNull, speculativeTypeInfo.Nullability.FlowState);
1520
verifySpeculativeTypeInfo(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1521
verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1523
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1524
verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1526
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1527
verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1529
void verifySpeculativeTypeInfo(int position,
PublicNullableFlowState
expectedFlowState)
1534
Assert.Equal(
PublicNullableFlowState
.NotNull, specTypeInfo.Nullability.FlowState);
1576
verifySpeculativeTypeInfo(ifStatement.SpanStart,
PublicNullableFlowState
.MaybeNull);
1577
verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart,
PublicNullableFlowState
.NotNull);
1579
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart,
PublicNullableFlowState
.MaybeNull);
1580
verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart,
PublicNullableFlowState
.NotNull);
1582
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart,
PublicNullableFlowState
.MaybeNull);
1583
verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart,
PublicNullableFlowState
.NotNull);
1585
void verifySpeculativeTypeInfo(int position,
PublicNullableFlowState
expectedFlowState)
1590
Assert.Equal(
PublicNullableFlowState
.NotNull, specTypeInfo.Nullability.FlowState);
1630
Assert.Equal(
PublicNullableFlowState
.MaybeNull, type.Nullability.FlowState);
1673
Assert.Equal(
PublicNullableFlowState
.None, type.Nullability.FlowState);
1716
Assert.Equal(
PublicNullableFlowState
.None, type.Nullability.FlowState);
1796
Assert.Equal(
PublicNullableFlowState
.MaybeNull, info.Nullability.FlowState);
1953
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
1954
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.ConvertedNullability.FlowState);
2297
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2567
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2568
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.ConvertedNullability.FlowState);
2921
Assert.Equal(
PublicNullableFlowState
.MaybeNull, typeInfo.Nullability.FlowState);
2925
Assert.Equal(
PublicNullableFlowState
.NotNull, typeInfo.Nullability.FlowState);
2930
Assert.Equal(
PublicNullableFlowState
.None, typeInfo.Nullability.FlowState);
4273
Assert.Equal(
PublicNullableFlowState
.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState);
4276
Assert.Equal(
PublicNullableFlowState
.NotNull, model.GetTypeInfo(default1).Nullability.FlowState);
4307
Assert.Equal(
PublicNullableFlowState
.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState);
4310
Assert.Equal(
PublicNullableFlowState
.NotNull, model.GetTypeInfo(default1).Nullability.FlowState);
4336
verify(exprs[0], PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
4337
verify(exprs[1], PublicNullableAnnotation.Annotated,
PublicNullableFlowState
.MaybeNull);
4339
void verify(DefaultExpressionSyntax expr, PublicNullableAnnotation expectedAnnotation,
PublicNullableFlowState
expectedState)
4822
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4827
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4852
Assert.Equal(
PublicNullableFlowState
.NotNull, info.Nullability.FlowState);
4917
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)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\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)
188
protected virtual
NullableFlowState
GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) =>
NullableFlowState
.None;
214
var
nullableFlowState =
NullableFlowState
.None;
QuickInfo\CommonSemanticQuickInfoProvider.TokenInfo.cs (4)
11
public readonly struct TokenInformation(ImmutableArray<ISymbol> symbols, bool showAwaitReturn = false,
NullableFlowState
nullableFlowState =
NullableFlowState
.None)
22
/// The nullable flow state to show in Quick Info; will be <see cref="
NullableFlowState
.None"/> to show nothing.
24
public readonly
NullableFlowState
NullableFlowState = nullableFlowState;
QuickInfo\QuickInfoUtilities.cs (4)
22
=> CreateQuickInfoItemAsync(services, semanticModel, span, symbols, supportedPlatforms: null, showAwaitReturn: false, flowState:
NullableFlowState
.None, options, onTheFlyDocsInfo: null, cancellationToken);
31
NullableFlowState
flowState,
139
NullableFlowState
.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name),
140
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)
614
Private Function ITypeSymbol_ToDisplayString(topLevelNullability As
NullableFlowState
, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToDisplayString
618
Private Function ITypeSymbol_ToDisplayParts(topLevelNullability As
NullableFlowState
, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToDisplayParts
622
Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As
NullableFlowState
, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString
626
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)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (4)
58
public string ToDisplayString(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
61
public ImmutableArray<SymbolDisplayPart> ToDisplayParts(
NullableFlowState
topLevelNullability, SymbolDisplayFormat format = null)
64
public string ToMinimalDisplayString(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)
67
public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel,
NullableFlowState
topLevelNullability, int position, SymbolDisplayFormat format = null)