286 references to NullableFlowState
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
StaticRouteHandlerModel\Emitters\EndpointJsonPreparationEmitter.cs (1)
19codeWriter.WriteLine($"var responseJsonTypeInfo = (JsonTypeInfo<{responseType.ToDisplayString(NullableFlowState.MaybeNull, EmitterConstants.DisplayFormat)}>)jsonSerializerOptions.GetTypeInfo(typeof({typeName}));");
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (2)
41return type.ToDisplayString(isOptional ? NullableFlowState.MaybeNull : NullableFlowState.NotNull, EmitterConstants.DisplayFormat);
Microsoft.CodeAnalysis (10)
Symbols\ITypeSymbol.cs (4)
144string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat? format = null); 153ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat? format = null); 167NullableFlowState topLevelNullability, 183NullableFlowState topLevelNullability,
Symbols\NullabilityInfo.cs (2)
26public NullableFlowState FlowState { get; } 28internal NullabilityInfo(NullableAnnotation annotation, NullableFlowState flowState)
Symbols\NullableFlowState.cs (4)
30/// This method directly converts a <see cref="NullableFlowState"/> to a <see cref="NullableAnnotation"/>, 35public static NullableAnnotation ToAnnotation(this NullableFlowState nullableFlowState) 39case CodeAnalysis.NullableFlowState.MaybeNull: 41case CodeAnalysis.NullableFlowState.NotNull:
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (4)
58public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 61public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 64public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 67public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
Microsoft.CodeAnalysis.CSharp (28)
BoundTree\BoundNode.cs (5)
255case CodeAnalysis.NullableFlowState.MaybeNull: 259case CodeAnalysis.NullableFlowState.NotNull: 290var flowState = (_attributes & BoundNodeAttributes.TopLevelFlowStateMaybeNull) == 0 ? CodeAnalysis.NullableFlowState.NotNull : CodeAnalysis.NullableFlowState.MaybeNull;
Compilation\CSharpSemanticModel.cs (2)
2100convertedNullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableFlowState.NotNull); 2251nullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableFlowState.NotNull);
SymbolDisplay\SymbolDisplay.cs (5)
42CodeAnalysis.NullableFlowState nullableFlowState, 104CodeAnalysis.NullableFlowState nullableFlowState, 149CodeAnalysis.NullableFlowState nullableFlowState, 196CodeAnalysis.NullableFlowState nullableFlowState, 219CodeAnalysis.NullableFlowState nullableFlowState,
Symbols\NullableFlowStateExtensions.cs (8)
29internal static CodeAnalysis.NullableFlowState ToPublicFlowState(this CSharp.NullableFlowState nullableFlowState) => 32CSharp.NullableFlowState.NotNull => CodeAnalysis.NullableFlowState.NotNull, 33CSharp.NullableFlowState.MaybeNull => CodeAnalysis.NullableFlowState.MaybeNull, 34CSharp.NullableFlowState.MaybeDefault => CodeAnalysis.NullableFlowState.MaybeNull, 39public static CSharp.NullableFlowState ToInternalFlowState(this CodeAnalysis.NullableFlowState flowState) => 42CodeAnalysis.NullableFlowState.None => CSharp.NullableFlowState.NotNull, 43CodeAnalysis.NullableFlowState.NotNull => CSharp.NullableFlowState.NotNull, 44CodeAnalysis.NullableFlowState.MaybeNull => CSharp.NullableFlowState.MaybeNull,
Symbols\PublicModel\TypeSymbol.cs (4)
147string ITypeSymbol.ToDisplayString(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format) 152ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToDisplayParts(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format) 157string ITypeSymbol.ToMinimalDisplayString(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format) 162ImmutableArray<SymbolDisplayPart> ITypeSymbol.ToMinimalDisplayParts(SemanticModel semanticModel, CodeAnalysis.NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format)
Symbols\TypeSymbol.cs (4)
663public string ToDisplayString(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 668public ImmutableArray<SymbolDisplayPart> ToDisplayParts(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 675CodeAnalysis.NullableFlowState topLevelNullability, 684CodeAnalysis.NullableFlowState topLevelNullability,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
84if (typeInfo.Nullability.FlowState == NullableFlowState.MaybeNull)
Microsoft.CodeAnalysis.CSharp.Features (4)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
760if (returnTypeInfo.Nullability.FlowState == NullableFlowState.MaybeNull)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
86protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) 92return NullableFlowState.None; 101return NullableFlowState.None;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (142)
Semantics\DynamicTests.cs (66)
4983Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 5064Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 5107Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 5187Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 5230Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 5311Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6029Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6109Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6152Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6232Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6272Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6352Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6678Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6741Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 6787Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6850Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 6897Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 6961Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 7066Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7123Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 7169Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7235Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7282Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7351Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7398Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7468Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7588Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7647Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7693Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7753Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7799Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7859Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 7903Assert.Equal(CodeAnalysis.NullableFlowState.None, typeInfo.Nullability.FlowState); 7974Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8034Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8080Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8140Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8185Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8244Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8290Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8353Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 8399Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8462Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 8508Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8571Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 8618Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 8682Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 8868Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10020Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10097Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10148Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10225Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10276Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10353Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10430Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10505Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10564Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10652Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10712Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10802Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 10982Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 11068Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 11324Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 11377Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 11591Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 11643Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState);
Semantics\NullableContextTests.cs (32)
353var expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.NullableFlowState.NotNull : Microsoft.CodeAnalysis.NullableFlowState.None; 392var expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.NullableFlowState.MaybeNull : Microsoft.CodeAnalysis.NullableFlowState.None; 427var expectedNullability = expectedFlowState ? Microsoft.CodeAnalysis.NullableFlowState.MaybeNull : Microsoft.CodeAnalysis.NullableFlowState.None; 1776Assert.Equal(Microsoft.CodeAnalysis.NullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 1781Assert.Equal(Microsoft.CodeAnalysis.NullableFlowState.None, typeInfo.Nullability.FlowState); 1804verify(source, Microsoft.CodeAnalysis.NullableFlowState.MaybeNull, ".ctor"); 1818verify(source, Microsoft.CodeAnalysis.NullableFlowState.MaybeNull, ".ctor"); 1832verify(source, Microsoft.CodeAnalysis.NullableFlowState.MaybeNull, ".ctor"); 1834static void verify(string source, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState, params string[] expectedAnalyzedKeys) 1880verify(attributeArguments[0], "A.F1 = null", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 1881verify(attributeArguments[1], "A.F2 = null", Microsoft.CodeAnalysis.NullableFlowState.None); 1886void verify(AttributeArgumentSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState) 1929verify(attributeArguments[0], "C1", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 1930verify(attributeArguments[1], "C2", Microsoft.CodeAnalysis.NullableFlowState.None); 1941void verify(AttributeArgumentSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState) 1971verify(equalsValueClauses[0], "(F1 = null)", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 1972verify(equalsValueClauses[1], "(F2 = null)", Microsoft.CodeAnalysis.NullableFlowState.None); 1977void verify(EqualsValueClauseSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState) 2011verify(declarations[0], "F1", Microsoft.CodeAnalysis.NullableFlowState.None); 2012verify(declarations[1], "F2", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 2013verify(declarations[2], "F3", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 2018void verify(VariableDeclaratorSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState) 2050verify(declarations[0], "P1", Microsoft.CodeAnalysis.NullableFlowState.None); 2051verify(declarations[1], "P2", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 2052verify(declarations[2], "P3", Microsoft.CodeAnalysis.NullableFlowState.MaybeNull); 2057void verify(PropertyDeclarationSyntax syntax, string expectedText, Microsoft.CodeAnalysis.NullableFlowState expectedFlowState)
Semantics\NullableReferenceTypesTests.cs (42)
56080Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 56110Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 56143Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState); 56180Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState); 56308Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 62846Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 126835private static readonly NullableFlowState[] s_AllNullableFlowStates = (NullableFlowState[])Enum.GetValues(typeof(NullableFlowState)); 126856var inputs = new[] { NullableFlowState.NotNull, NullableFlowState.MaybeNull }; 126858Func<int, int, NullableFlowState> getResult = (i, j) => inputs[i].Join(inputs[j]); 126860var expected = new NullableFlowState[2, 2] 126862{ NullableFlowState.NotNull, NullableFlowState.MaybeNull }, 126863{ NullableFlowState.MaybeNull, NullableFlowState.MaybeNull }, 126888var inputs = new[] { NullableFlowState.NotNull, NullableFlowState.MaybeNull }; 126889Func<int, int, NullableFlowState> getResult = (i, j) => inputs[i].Meet(inputs[j]); 126891var expected = new NullableFlowState[2, 2] 126893{ NullableFlowState.NotNull, NullableFlowState.NotNull }, 126894{ NullableFlowState.NotNull, NullableFlowState.MaybeNull }, 126921private static void AssertEqual(NullableFlowState[,] expected, Func<int, int, NullableFlowState> getResult, int size) 126923AssertEx.Equal<NullableFlowState>(expected, getResult, (na1, na2) => na1 == na2, na => $"NullableFlowState.{na}", "{0,-32:G}", size); 126942foreach (var a in s_AllNullableFlowStates) 126944foreach (var b in s_AllNullableFlowStates) 126972foreach (var a in s_AllNullableFlowStates) 126974foreach (var b in s_AllNullableFlowStates) 126976foreach (var c in s_AllNullableFlowStates) 127006foreach (var a in s_AllNullableFlowStates) 127008foreach (var b in s_AllNullableFlowStates) 127010foreach (var c in s_AllNullableFlowStates) 127059foreach (var a in s_AllNullableFlowStates) 127061foreach (var b in s_AllNullableFlowStates) 127087foreach (var a in s_AllNullableFlowStates) 127089foreach (var b in s_AllNullableFlowStates) 161253Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 161299Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState);
Semantics\TopLevelStatementsTests.cs (2)
1523Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState); 1526Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (62)
Compilation\SemanticModelGetSemanticInfoTests.cs (4)
8557Assert.Equal(CodeAnalysis.NullableFlowState.None, semanticInfo.Nullability.FlowState); 8558Assert.Equal(CodeAnalysis.NullableFlowState.None, semanticInfo.ConvertedNullability.FlowState); 8602Assert.Equal(CodeAnalysis.NullableFlowState.None, semanticInfo.Nullability.FlowState); 8603Assert.Equal(CodeAnalysis.NullableFlowState.None, semanticInfo.ConvertedNullability.FlowState);
Compilation\TypeInfoTests.cs (2)
22var notNullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableFlowState.NotNull); 23var nullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.Annotated, CodeAnalysis.NullableFlowState.MaybeNull);
Symbols\Source\NullablePublicAPITests.cs (56)
20using PublicNullableFlowState = Microsoft.CodeAnalysis.NullableFlowState; 1098Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.Nullability.FlowState); 1216var nullable = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 1217var notNullable = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated, PublicNullableFlowState.NotNull); 1265var notNull = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated, PublicNullableFlowState.NotNull); 1266var @null = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 1376verifySpeculativeModel(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1379verifySpeculativeModel(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1382verifySpeculativeModel(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1385verifySpeculativeModel(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1388verifySpeculativeModel(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1391verifySpeculativeModel(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1393void verifySpeculativeModel(int spanStart, PublicNullableFlowState conditionFlowState) 1401Assert.Equal(PublicNullableFlowState.NotNull, speculativeTypeInfo.Nullability.FlowState); 1404Assert.Equal(PublicNullableFlowState.NotNull, referenceTypeInfo.Nullability.FlowState); 1406Assert.Equal(PublicNullableFlowState.NotNull, coalesceTypeInfo.Nullability.FlowState); 1446Assert.Equal(PublicNullableFlowState.NotNull, speculativeTypeInfo.Nullability.FlowState); 1520verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1521verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1523verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1524verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1526verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1527verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1529void verifySpeculativeTypeInfo(int position, PublicNullableFlowState expectedFlowState) 1534Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.Nullability.FlowState); 1576verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1577verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1579verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1580verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1582verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1583verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1585void verifySpeculativeTypeInfo(int position, PublicNullableFlowState expectedFlowState) 1590Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.Nullability.FlowState); 1630Assert.Equal(PublicNullableFlowState.MaybeNull, type.Nullability.FlowState); 1673Assert.Equal(PublicNullableFlowState.None, type.Nullability.FlowState); 1716Assert.Equal(PublicNullableFlowState.None, type.Nullability.FlowState); 1796Assert.Equal(PublicNullableFlowState.MaybeNull, info.Nullability.FlowState); 1953Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 1954Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.ConvertedNullability.FlowState); 2297Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2567Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2568Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.ConvertedNullability.FlowState); 2921Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2925Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.Nullability.FlowState); 2930Assert.Equal(PublicNullableFlowState.None, typeInfo.Nullability.FlowState); 4273Assert.Equal(PublicNullableFlowState.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState); 4276Assert.Equal(PublicNullableFlowState.NotNull, model.GetTypeInfo(default1).Nullability.FlowState); 4307Assert.Equal(PublicNullableFlowState.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState); 4310Assert.Equal(PublicNullableFlowState.NotNull, model.GetTypeInfo(default1).Nullability.FlowState); 4336verify(exprs[0], PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 4337verify(exprs[1], PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 4339void verify(DefaultExpressionSyntax expr, PublicNullableAnnotation expectedAnnotation, PublicNullableFlowState expectedState) 4822Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4827Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4852Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4917Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
474Assert.NotEqual(CodeAnalysis.NullableFlowState.None, typeInfo.Nullability.FlowState);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableHelpers.cs (1)
84if (typeInfo.Nullability.FlowState == NullableFlowState.MaybeNull)
Microsoft.CodeAnalysis.Features (16)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (4)
120public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 123public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 126public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 129public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
QuickInfo\CommonSemanticQuickInfoProvider.cs (4)
188protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 214var nullableFlowState = NullableFlowState.None;
QuickInfo\CommonSemanticQuickInfoProvider.TokenInfo.cs (4)
11public 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. 24public 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); 31NullableFlowState flowState, 139NullableFlowState.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name), 140NullableFlowState.NotNull => string.Format(FeaturesResources._0_is_not_null_here, symbol.Name),
Microsoft.CodeAnalysis.UnitTests (6)
Symbols\NullabilityInfoTests.cs (6)
19assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.NotNull), 20new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.NotNull), 23assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.NotNull), 24new NullabilityInfo(NullableAnnotation.NotAnnotated, NullableFlowState.NotNull), 27assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.MaybeNull), 28new NullabilityInfo(NullableAnnotation.Annotated, NullableFlowState.NotNull),
Microsoft.CodeAnalysis.VisualBasic (4)
Symbols\TypeSymbol.vb (4)
614Private Function ITypeSymbol_ToDisplayString(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToDisplayString 618Private Function ITypeSymbol_ToDisplayParts(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToDisplayParts 622Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString 626Private 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)
58public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 61public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 64public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 67public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)