183 references to NullableFlowState
Microsoft.CodeAnalysis (10)
Symbols\ITypeSymbol.cs (4)
140string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat? format = null); 149ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat? format = null); 163NullableFlowState topLevelNullability, 179NullableFlowState 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)
CodeGenerationTypeSymbol.cs (4)
64public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 67public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 70public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 73public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)
Microsoft.CodeAnalysis.CSharp (28)
BoundTree\BoundNode.cs (5)
242case CodeAnalysis.NullableFlowState.MaybeNull: 246case CodeAnalysis.NullableFlowState.NotNull: 277var flowState = (_attributes & BoundNodeAttributes.TopLevelFlowStateMaybeNull) == 0 ? CodeAnalysis.NullableFlowState.NotNull : CodeAnalysis.NullableFlowState.MaybeNull;
Compilation\CSharpSemanticModel.cs (2)
2121convertedNullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableFlowState.NotNull); 2249nullability = new NullabilityInfo(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableFlowState.NotNull);
SymbolDisplay\SymbolDisplay.cs (5)
40CodeAnalysis.NullableFlowState nullableFlowState, 80CodeAnalysis.NullableFlowState nullableFlowState, 123CodeAnalysis.NullableFlowState nullableFlowState, 170CodeAnalysis.NullableFlowState nullableFlowState, 193CodeAnalysis.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)
661public string ToDisplayString(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 666public ImmutableArray<SymbolDisplayPart> ToDisplayParts(CodeAnalysis.NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 673CodeAnalysis.NullableFlowState topLevelNullability, 682CodeAnalysis.NullableFlowState topLevelNullability,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
NullableHelpers.cs (1)
84if (typeInfo.Nullability.FlowState == NullableFlowState.MaybeNull)
Microsoft.CodeAnalysis.CSharp.Features (4)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
811if (returnTypeInfo.Nullability.FlowState == NullableFlowState.MaybeNull)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (3)
78protected override NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) 84return NullableFlowState.None; 93return NullableFlowState.None;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (42)
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 (8)
53900Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 53930Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 53963Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState); 54000Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, model.GetTypeInfo(defaultNode).ConvertedNullability.FlowState); 54128Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model.GetTypeInfo(nullNode).ConvertedNullability.FlowState); 60398Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 156842Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState); 156888Assert.Equal(CodeAnalysis.NullableFlowState.NotNull, typeInfo.Nullability.FlowState);
Semantics\TopLevelStatementsTests.cs (2)
1511Assert.Equal(CodeAnalysis.NullableFlowState.MaybeNull, model1.GetTypeInfo(reference).Nullability.FlowState); 1514Assert.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)
18using PublicNullableFlowState = Microsoft.CodeAnalysis.NullableFlowState; 1096Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.Nullability.FlowState); 1214var nullable = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 1215var notNullable = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated, PublicNullableFlowState.NotNull); 1263var notNull = new NullabilityInfo(PublicNullableAnnotation.NotAnnotated, PublicNullableFlowState.NotNull); 1264var @null = new NullabilityInfo(PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 1374verifySpeculativeModel(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1377verifySpeculativeModel(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1380verifySpeculativeModel(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1383verifySpeculativeModel(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1386verifySpeculativeModel(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1389verifySpeculativeModel(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1391void verifySpeculativeModel(int spanStart, PublicNullableFlowState conditionFlowState) 1399Assert.Equal(PublicNullableFlowState.NotNull, speculativeTypeInfo.Nullability.FlowState); 1402Assert.Equal(PublicNullableFlowState.NotNull, referenceTypeInfo.Nullability.FlowState); 1404Assert.Equal(PublicNullableFlowState.NotNull, coalesceTypeInfo.Nullability.FlowState); 1444Assert.Equal(PublicNullableFlowState.NotNull, speculativeTypeInfo.Nullability.FlowState); 1518verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1519verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1521verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1522verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1524verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1525verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1527void verifySpeculativeTypeInfo(int position, PublicNullableFlowState expectedFlowState) 1532Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.Nullability.FlowState); 1574verifySpeculativeTypeInfo(ifStatement.SpanStart, PublicNullableFlowState.MaybeNull); 1575verifySpeculativeTypeInfo(ifStatement.Statement.SpanStart, PublicNullableFlowState.NotNull); 1577verifySpeculativeTypeInfo(conditionalAccessExpression.SpanStart, PublicNullableFlowState.MaybeNull); 1578verifySpeculativeTypeInfo(conditionalAccessExpression.WhenNotNull.SpanStart, PublicNullableFlowState.NotNull); 1580verifySpeculativeTypeInfo(ternary.WhenTrue.SpanStart, PublicNullableFlowState.MaybeNull); 1581verifySpeculativeTypeInfo(ternary.WhenFalse.SpanStart, PublicNullableFlowState.NotNull); 1583void verifySpeculativeTypeInfo(int position, PublicNullableFlowState expectedFlowState) 1588Assert.Equal(PublicNullableFlowState.NotNull, specTypeInfo.Nullability.FlowState); 1628Assert.Equal(PublicNullableFlowState.MaybeNull, type.Nullability.FlowState); 1674Assert.Equal(PublicNullableFlowState.None, type.Nullability.FlowState); 1717Assert.Equal(PublicNullableFlowState.None, type.Nullability.FlowState); 1797Assert.Equal(PublicNullableFlowState.MaybeNull, info.Nullability.FlowState); 1954Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 1955Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.ConvertedNullability.FlowState); 2298Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2568Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2569Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.ConvertedNullability.FlowState); 2922Assert.Equal(PublicNullableFlowState.MaybeNull, typeInfo.Nullability.FlowState); 2926Assert.Equal(PublicNullableFlowState.NotNull, typeInfo.Nullability.FlowState); 2931Assert.Equal(PublicNullableFlowState.None, typeInfo.Nullability.FlowState); 4274Assert.Equal(PublicNullableFlowState.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState); 4277Assert.Equal(PublicNullableFlowState.NotNull, model.GetTypeInfo(default1).Nullability.FlowState); 4308Assert.Equal(PublicNullableFlowState.MaybeNull, model.GetTypeInfo(default0).Nullability.FlowState); 4311Assert.Equal(PublicNullableFlowState.NotNull, model.GetTypeInfo(default1).Nullability.FlowState); 4337verify(exprs[0], PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 4338verify(exprs[1], PublicNullableAnnotation.Annotated, PublicNullableFlowState.MaybeNull); 4340void verify(DefaultExpressionSyntax expr, PublicNullableAnnotation expectedAnnotation, PublicNullableFlowState expectedState) 4823Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4828Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4853Assert.Equal(PublicNullableFlowState.NotNull, info.Nullability.FlowState); 4918Assert.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)
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)
182protected virtual NullableFlowState GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) => NullableFlowState.None; 208var 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. 24public readonly NullableFlowState NullableFlowState; 26public 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); 34NullableFlowState flowState, 135NullableFlowState.MaybeNull => string.Format(FeaturesResources._0_may_be_null_here, symbol.Name), 136NullableFlowState.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)
604Private Function ITypeSymbol_ToDisplayString(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToDisplayString 608Private Function ITypeSymbol_ToDisplayParts(topLevelNullability As NullableFlowState, Optional format As SymbolDisplayFormat = Nothing) As ImmutableArray(Of SymbolDisplayPart) Implements ITypeSymbol.ToDisplayParts 612Private Function ITypeSymbol_ToMinimalDisplayString(semanticModel As SemanticModel, topLevelNullability As NullableFlowState, position As Integer, Optional format As SymbolDisplayFormat = Nothing) As String Implements ITypeSymbol.ToMinimalDisplayString 616Private 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)
64public string ToDisplayString(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 67public ImmutableArray<SymbolDisplayPart> ToDisplayParts(NullableFlowState topLevelNullability, SymbolDisplayFormat format = null) 70public string ToMinimalDisplayString(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null) 73public ImmutableArray<SymbolDisplayPart> ToMinimalDisplayParts(SemanticModel semanticModel, NullableFlowState topLevelNullability, int position, SymbolDisplayFormat format = null)