1 write to Nullability
Microsoft.CodeAnalysis (1)
Compilation\TypeInfo.cs (1)
46
this.
Nullability
= nullability;
147 references to Nullability
Microsoft.CodeAnalysis (3)
Compilation\TypeInfo.cs (3)
55
&& this.
Nullability
.Equals(other.
Nullability
)
68
Hash.Combine(this.
Nullability
.GetHashCode(),
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
13
=> typeInfo.Type?.WithNullableAnnotation(typeInfo.
Nullability
.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
84
if (typeInfo.
Nullability
.FlowState == NullableFlowState.MaybeNull)
Microsoft.CodeAnalysis.CSharp.Features (2)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
760
if (returnTypeInfo.
Nullability
.FlowState == NullableFlowState.MaybeNull)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
135
return typeInfo.
Nullability
.FlowState;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (102)
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 (12)
354
Assert.Equal(expectedNullability, typeInfo.
Nullability
.FlowState);
393
Assert.Equal(expectedNullability, typeInfo.
Nullability
.FlowState);
428
Assert.Equal(expectedNullability, typeInfo.
Nullability
.FlowState);
1776
Assert.Equal(Microsoft.CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.
Nullability
.FlowState);
1781
Assert.Equal(Microsoft.CodeAnalysis.NullableFlowState.None, typeInfo.
Nullability
.FlowState);
1844
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
1890
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
1945
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
1982
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
2022
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
2061
Assert.Equal(expectedFlowState, typeInfo.
Nullability
.FlowState);
2232
Assert.Equal(expectedAnnotation, typeInfo.
Nullability
.Annotation);
Semantics\NullableReferenceTypesTests.cs (20)
59024
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, model.GetTypeInfo(declaration.Type).
Nullability
.Annotation);
62846
Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.
Nullability
.FlowState);
62847
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, typeInfo.
Nullability
.Annotation);
71879
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, model.GetTypeInfo(discard1).
Nullability
.Annotation);
71884
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, model.GetTypeInfo(discard2).
Nullability
.Annotation);
71889
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, model.GetTypeInfo(discard3).
Nullability
.Annotation);
71894
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, model.GetTypeInfo(discard4).
Nullability
.Annotation);
71928
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(discard1).
Nullability
.Annotation);
71937
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(discard2).
Nullability
.Annotation);
71966
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(discardPattern1).
Nullability
.Annotation);
71972
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(discardPattern2).
Nullability
.Annotation);
146472
Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, typeInfo.
Nullability
.Annotation);
155998
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, model.GetTypeInfo(identifiers[0]).
Nullability
.Annotation);
155999
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(identifiers[1]).
Nullability
.Annotation);
156000
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, model.GetTypeInfo(identifiers[2]).
Nullability
.Annotation);
156001
Assert.Equal(CodeAnalysis.NullableAnnotation.None, model.GetTypeInfo(identifiers[3]).
Nullability
.Annotation);
161253
Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.
Nullability
.FlowState);
161254
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, typeInfo.
Nullability
.Annotation);
161299
Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.
Nullability
.FlowState);
161300
Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, typeInfo.
Nullability
.Annotation);
Semantics\TopLevelStatementsTests.cs (4)
1523
Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model1.GetTypeInfo(reference).
Nullability
.FlowState);
1526
Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model1.GetTypeInfo(reference).
Nullability
.FlowState);
1594
_ = model1.GetTypeInfo(id).
Nullability
;
1600
_ = model2.GetTypeInfo(id).
Nullability
;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (31)
Compilation\SemanticModelAPITests.cs (3)
4493
Assert.Equal(CodeAnalysis.NullableAnnotation.None, typeInfo.
Nullability
.Annotation);
4557
Assert.Equal(CodeAnalysis.NullableAnnotation.None, typeInfo.
Nullability
.Annotation);
4571
Assert.Equal(CodeAnalysis.NullableAnnotation.None, typeInfo.
Nullability
.Annotation);
Symbols\Source\NullablePublicAPITests.cs (28)
1404
Assert.Equal(PublicNullableFlowState.NotNull, referenceTypeInfo.
Nullability
.FlowState);
1406
Assert.Equal(PublicNullableFlowState.NotNull, coalesceTypeInfo.
Nullability
.FlowState);
1411
Assert.Equal(conditionFlowState, referenceTypeInfo.
Nullability
.FlowState);
1414
Assert.Equal(conditionFlowState, coalesceTypeInfo.
Nullability
.FlowState);
1532
Assert.Equal(expectedFlowState, specTypeInfo.
Nullability
.FlowState);
1534
Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.
Nullability
.FlowState);
1588
Assert.Equal(expectedFlowState, specTypeInfo.
Nullability
.FlowState);
1590
Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.
Nullability
.FlowState);
1630
Assert.Equal(PublicNullableFlowState.MaybeNull, type.
Nullability
.FlowState);
1631
Assert.Equal(PublicNullableAnnotation.Annotated, type.
Nullability
.Annotation);
1673
Assert.Equal(PublicNullableFlowState.None, type.
Nullability
.FlowState);
1674
Assert.Equal(PublicNullableAnnotation.None, type.
Nullability
.Annotation);
1716
Assert.Equal(PublicNullableFlowState.None, type.
Nullability
.FlowState);
1717
Assert.Equal(PublicNullableAnnotation.None, type.
Nullability
.Annotation);
1795
Assert.Equal(PublicNullableAnnotation.Annotated, info.
Nullability
.Annotation);
1796
Assert.Equal(PublicNullableFlowState.MaybeNull, info.
Nullability
.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);
4822
Assert.Equal(PublicNullableFlowState.NotNull, info.
Nullability
.FlowState);
4827
Assert.Equal(PublicNullableFlowState.NotNull, info.
Nullability
.FlowState);
4851
Assert.Equal(PublicNullableAnnotation.NotAnnotated, info.
Nullability
.Annotation);
4852
Assert.Equal(PublicNullableFlowState.NotNull, info.
Nullability
.FlowState);
4917
Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.
Nullability
.FlowState);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CompilationTestUtils.cs (5)
240
summary.Nullability = typeInfo.
Nullability
;
277
summary.Nullability = typeInfo.
Nullability
;
314
summary.Nullability = typeInfo.
Nullability
;
474
Assert.NotEqual(CodeAnalysis.NullableFlowState.None, typeInfo.
Nullability
.FlowState);
478
(annotation.IsConverted ? typeInfo.ConvertedNullability : typeInfo.
Nullability
).FlowState.ToInternalFlowState()).ToTypeWithAnnotations(compilation);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (1)
13
=> typeInfo.Type?.WithNullableAnnotation(typeInfo.
Nullability
.Annotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
84
if (typeInfo.
Nullability
.FlowState == NullableFlowState.MaybeNull)