70 references to MaybeNull
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
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 (1)
41
return type.ToDisplayString(isOptional ? NullableFlowState.
MaybeNull
: NullableFlowState.NotNull, EmitterConstants.DisplayFormat);
Microsoft.CodeAnalysis (1)
Symbols\NullableFlowState.cs (1)
39
case CodeAnalysis.NullableFlowState.
MaybeNull
:
Microsoft.CodeAnalysis.CSharp (5)
BoundTree\BoundNode.cs (2)
255
case CodeAnalysis.NullableFlowState.
MaybeNull
:
290
var flowState = (_attributes & BoundNodeAttributes.TopLevelFlowStateMaybeNull) == 0 ? CodeAnalysis.NullableFlowState.NotNull : CodeAnalysis.NullableFlowState.
MaybeNull
;
Symbols\NullableFlowStateExtensions.cs (3)
33
CSharp.NullableFlowState.MaybeNull => CodeAnalysis.NullableFlowState.
MaybeNull
,
34
CSharp.NullableFlowState.MaybeDefault => CodeAnalysis.NullableFlowState.
MaybeNull
,
44
CodeAnalysis.NullableFlowState.
MaybeNull
=> CSharp.NullableFlowState.MaybeNull,
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 (1)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
760
if (returnTypeInfo.Nullability.FlowState == NullableFlowState.
MaybeNull
)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (33)
Semantics\DynamicTests.cs (8)
6741
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
6850
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
6961
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
7123
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
8353
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
8462
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
8571
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
8682
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, typeInfo.Nullability.FlowState);
Semantics\NullableContextTests.cs (13)
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);
1804
verify(source, Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
, ".ctor");
1818
verify(source, Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
, ".ctor");
1832
verify(source, Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
, ".ctor");
1880
verify(attributeArguments[0], "A.F1 = null", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
1929
verify(attributeArguments[0], "C1", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
1971
verify(equalsValueClauses[0], "(F1 = null)", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
2012
verify(declarations[1], "F2", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
2013
verify(declarations[2], "F3", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
2051
verify(declarations[1], "P2", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
2052
verify(declarations[2], "P3", Microsoft.CodeAnalysis.NullableFlowState.
MaybeNull
);
Semantics\NullableReferenceTypesTests.cs (10)
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);
56308
Assert.Equal(CodeAnalysis.NullableFlowState.
MaybeNull
, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState);
126856
var inputs = new[] { NullableFlowState.NotNull, NullableFlowState.
MaybeNull
};
126862
{ NullableFlowState.NotNull, NullableFlowState.
MaybeNull
},
126863
{ NullableFlowState.
MaybeNull
, NullableFlowState.
MaybeNull
},
126888
var inputs = new[] { NullableFlowState.NotNull, NullableFlowState.
MaybeNull
};
126894
{ NullableFlowState.NotNull, NullableFlowState.
MaybeNull
},
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 (24)
Compilation\TypeInfoTests.cs (1)
23
var nullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableFlowState.
MaybeNull
);
Symbols\Source\NullablePublicAPITests.cs (23)
1216
var nullable = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.
MaybeNull
);
1266
var @null = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.
MaybeNull
);
1376
verifySpeculativeModel(ifStatement.SpanStart, PublicNullableFlowState.
MaybeNull
);
1382
verifySpeculativeModel(conditionalAccessExpression.SpanStart, PublicNullableFlowState.
MaybeNull
);
1388
verifySpeculativeModel(ternary.WhenTrue.SpanStart, PublicNullableFlowState.
MaybeNull
);
1520
verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.
MaybeNull
);
1523
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.
MaybeNull
);
1526
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.
MaybeNull
);
1576
verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.
MaybeNull
);
1579
verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.
MaybeNull
);
1582
verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.
MaybeNull
);
1630
Assert.Equal(PublicNullableFlowState.
MaybeNull
, 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);
4273
Assert.Equal(PublicNullableFlowState.
MaybeNull
, model.GetTypeInfo(default0).Nullability.FlowState);
4307
Assert.Equal(PublicNullableFlowState.
MaybeNull
, model.GetTypeInfo(default0).Nullability.FlowState);
4336
verify(exprs[0], PublicNullableAnnotation.Annotated, PublicNullableFlowState.
MaybeNull
);
4337
verify(exprs[1], PublicNullableAnnotation.Annotated, PublicNullableFlowState.
MaybeNull
);
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 (1)
QuickInfo\QuickInfoUtilities.cs (1)
139
NullableFlowState.
MaybeNull
=> string.Format(FeaturesResources._0_may_be_null_here, symbol.Name),
Microsoft.CodeAnalysis.UnitTests (1)
Symbols\NullabilityInfoTests.cs (1)
27
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.
MaybeNull
),