3 implementations of NullableAnnotation
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
25CodeAnalysis.NullableAnnotation ITypeSymbol.NullableAnnotation => NullableAnnotation;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
151NullableAnnotation ITypeSymbol.NullableAnnotation => throw new NotImplementedException();
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
772Private ReadOnly Property ITypeSymbol_NullableAnnotation As NullableAnnotation Implements ITypeSymbol.NullableAnnotation
227 references to NullableAnnotation
Microsoft.Analyzers.Extra (3)
CoalesceAnalyzer.cs (2)
36&& type.NullableAnnotation == NullableAnnotation.NotAnnotated 63&& type.NullableAnnotation == NullableAnnotation.NotAnnotated
ConditionalAccessAnalyzer.cs (1)
95if (type.NullableAnnotation == NullableAnnotation.NotAnnotated)
Microsoft.AspNetCore.App.Analyzers (2)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
167NullableAnnotation: NullableAnnotation.Annotated 173NullableAnnotation: NullableAnnotation.Annotated
Microsoft.AspNetCore.Http.RequestDelegateGenerator (8)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
167NullableAnnotation: NullableAnnotation.Annotated 173NullableAnnotation: NullableAnnotation.Annotated
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (3)
115if (endpointParameter.ElementType.NullableAnnotation == NullableAnnotation.Annotated) 137if (endpointParameter.IsOptional || endpointParameter.Type.NullableAnnotation == NullableAnnotation.Annotated) 177if (parameter.IsArray && parameter.ElementType.NullableAnnotation == NullableAnnotation.Annotated)
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (3)
40var isOptional = p.IsOptional || type.NullableAnnotation == NullableAnnotation.Annotated; 92if (endpoint.Response.IsAwaitable && endpoint.Response.WrappedResponseType.NullableAnnotation == NullableAnnotation.Annotated) 425if (endpoint.Response?.WrappedResponseType.NullableAnnotation == NullableAnnotation.Annotated)
Microsoft.CodeAnalysis (2)
Compilation\TypeInfo.cs (2)
43Debug.Assert(type is null || type.NullableAnnotation == nullability.FlowState.ToAnnotation()); 44Debug.Assert(convertedType is null || convertedType.NullableAnnotation == convertedNullability.FlowState.ToAnnotation());
Microsoft.CodeAnalysis.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
34var isNonNullableReferenceType = type.IsReferenceType && type.NullableAnnotation != NullableAnnotation.Annotated; 730=> type.WithNullableAnnotation(symbolForNullableAnnotation.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
92return _typeGenerator.Construct(symbol.OriginalDefinition, [.. substitutedArguments]).WithNullableAnnotation(symbol.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
99if (x.NullableAnnotation == y.NullableAnnotation) 103return (x.NullableAnnotation, y.NullableAnnotation) switch
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
54=> _symbolEquivalenceComparer._ignoreNullableAnnotations ? 0 : ((int)type.NullableAnnotation).GetHashCode();
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
31namedType.NullableAnnotation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
62public NullableAnnotation ReceiverNullableAnnotation => ReceiverType.NullableAnnotation; 63public NullableAnnotation ReturnNullableAnnotation => ReturnType.NullableAnnotation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
120typeParameter.NullableAnnotation,
Microsoft.CodeAnalysis.CSharp (6)
Compilation\CSharpCompilation.cs (3)
4036return CreatePointerTypeSymbol(elementType.EnsureCSharpSymbolOrNull(nameof(elementType)), elementType.NullableAnnotation.ToInternalAnnotation()).GetPublicSymbol(); 4092var returnTypeWithAnnotations = TypeWithAnnotations.Create(returnType.EnsureCSharpSymbolOrNull(nameof(returnType)), returnType.NullableAnnotation.ToInternalAnnotation()); 4147var annotation = (elementNullableAnnotations.IsDefault ? typeSymbol.NullableAnnotation : elementNullableAnnotations[i]).ToInternalAnnotation();
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
74AddPunctuation(type.NullableAnnotation == CodeAnalysis.NullableAnnotation.Annotated ? SyntaxKind.QuestionToken : SyntaxKind.ExclamationToken); 80switch (type.NullableAnnotation)
Symbols\PublicModel\Symbol.cs (1)
25builder.Add(TypeWithAnnotations.Create(type, (typeArg?.NullableAnnotation.ToInternalAnnotation() ?? NullableAnnotation.NotAnnotated)));
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
245if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.Annotated })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
159if (typeSymbol.NullableAnnotation == NullableAnnotation.Annotated)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
59var additionalAnnotation = type.NullableAnnotation switch 64_ => throw ExceptionUtilities.UnexpectedValue(type.NullableAnnotation),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (5)
68if (underlyingType.NullableAnnotation == NullableAnnotation.Annotated) 102if (symbol.NullableAnnotation == NullableAnnotation.Annotated) 113return symbol.NullableAnnotation is NullableAnnotation.Annotated 308if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 363if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
Microsoft.CodeAnalysis.CSharp.Features (3)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
1058if (methodSymbol.ReturnType.NullableAnnotation != NullableAnnotation.Annotated)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
245if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.Annotated })
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
159if (typeSymbol.NullableAnnotation == NullableAnnotation.Annotated)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IConversionExpression.cs (1)
5294Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, iopTree.Value.Type.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (11)
Semantics\NativeIntegerTests.cs (1)
1626Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, underlyingType.NullableAnnotation);
Semantics\NullableReferenceTypesTests.cs (10)
5174Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145380Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145421Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145461Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145499Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145537Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145641Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 145680Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation); 154885symbol.Type.NullableAnnotation); 158820Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, local.Type.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (114)
Compilation\CompilationAPITests.cs (8)
2466Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementType.NullableAnnotation); 2474Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementType.NullableAnnotation); 2482Assert.Equal(CodeAnalysis.NullableAnnotation.None, arrayType.ElementType.NullableAnnotation); 2493Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType).ElementType.NullableAnnotation); 2495Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.None).ElementType.NullableAnnotation); 2497Assert.Equal(CodeAnalysis.NullableAnnotation.None, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.None).ElementType.NullableAnnotation); 2499Assert.Equal(CodeAnalysis.NullableAnnotation.NotAnnotated, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.NotAnnotated).ElementType.NullableAnnotation); 2501Assert.Equal(CodeAnalysis.NullableAnnotation.Annotated, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.Annotated).ElementType.NullableAnnotation);
Symbols\Source\NullablePublicAPITests.cs (106)
151var result = member.Type.NullableAnnotation; 153return member.Type.NullableAnnotation; 218var result = member.Type.NullableAnnotation; 292var result = member.ReturnType.NullableAnnotation; 381var result = member.Type.NullableAnnotation; 503var result = m.ReceiverType.NullableAnnotation; 575Assert.Equal(method.ReturnNullableAnnotation, method.Parameters[0].Type.NullableAnnotation); 577Assert.Equal(PublicNullableAnnotation.None, method.ReceiverType.NullableAnnotation); 578var result = method.ReturnType.NullableAnnotation; 641var result = member.Type.NullableAnnotation; 697var result = array.ElementType.NullableAnnotation; 760var result = method.ReturnType.NullableAnnotation; 826var result = typeParameterSymbol.ConstraintTypes.Single().NullableAnnotation; 892var result = ((INamedTypeSymbol)method.ReturnType).TypeArguments.Single().NullableAnnotation; 949var result = method.TypeArguments.Single().NullableAnnotation; 1006var result = localSymbol.Type.NullableAnnotation; 1178Assert.Equal(declaredSymbol.Type.NullableAnnotation, declaredSymbol.NullableAnnotation); 1861Assert.Equal(expectedAnnotation, methodSymbol.TypeArguments.Single().NullableAnnotation); 1863Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 1865Assert.Equal(expectedAnnotation, methodSymbol.ReturnType.NullableAnnotation); 1904Assert.Equal(expectedAnnotation, methodSymbol.TypeArguments.Single().NullableAnnotation); 1906Assert.Equal(expectedAnnotation, methodSymbol.Parameters.Single().Type.NullableAnnotation); 1950Assert.Equal(PublicNullableAnnotation.Annotated, symbol.Type.NullableAnnotation); 1997Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2058Assert.Equal(expectedAnnotation1, symbols[0].Type.NullableAnnotation); 2060Assert.Equal(expectedAnnotation2, symbols[1].Type.NullableAnnotation); 2101Assert.Equal(expectedAnnotation1, symbols[0].Type.NullableAnnotation); 2103Assert.Equal(expectedAnnotation2, symbols[1].Type.NullableAnnotation); 2140Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation); 2144Assert.Equal(PublicNullableAnnotation.Annotated, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation); 2189Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2221Assert.Equal(PublicNullableAnnotation.Annotated, symbol.Type.NullableAnnotation); 2259Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2291Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2337Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2379Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2422Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2464Assert.Equal(PublicNullableAnnotation.Annotated, symbol.Type.NullableAnnotation); 2512Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2561Assert.Equal(expectedAnnotation, symbol.Type.NullableAnnotation); 2603Assert.Equal(expectedElementTypeAnnotation, foreachInfo.ElementType.NullableAnnotation); 2741Assert.Equal(PublicNullableAnnotation.Annotated, ((IPropertySymbol)symInfo.Symbol).Type.NullableAnnotation); 2746Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IPropertySymbol)symInfo.Symbol).Type.NullableAnnotation); 2787Assert.Equal(PublicNullableAnnotation.Annotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 2792Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation); 2830Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2835Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2879Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2884Assert.Equal(PublicNullableAnnotation.Annotated, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation); 2920Assert.Equal(PublicNullableAnnotation.Annotated, typeInfo.Type.NullableAnnotation); 2924Assert.Equal(PublicNullableAnnotation.NotAnnotated, typeInfo.Type.NullableAnnotation); 2929Assert.Equal(PublicNullableAnnotation.None, typeInfo.Type.NullableAnnotation); 2968Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3010Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3052Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[0].NullableAnnotation); 3054Assert.Equal(expectedAnnotation, ((IMethodSymbol)symbolInfo.Symbol).TypeArguments[1].NullableAnnotation); 3115Assert.Equal(PublicNullableAnnotation.None, ((IMethodSymbol)symbol).TypeArguments[0].NullableAnnotation); 3159Assert.Equal(annotation1, methodSymbol.TypeArguments[0].NullableAnnotation); 3161Assert.Equal(annotation2, methodSymbol.TypeArguments[1].NullableAnnotation); 3204Assert.Equal(annotation, methodSymbol.TypeArguments[0].NullableAnnotation); 3274Assert.Equal(firstAnnotation, propertySymbol.Type.NullableAnnotation); 3276Assert.Equal(secondAnnotation, propertySymbol.Parameters[0].Type.NullableAnnotation); 3325Assert.Equal(annotation, propertySymbol.Type.NullableAnnotation); 3493Assert.Equal(PublicNullableAnnotation.Annotated, lambdaSymbol.Parameters[0].Type.NullableAnnotation); 3505Assert.Equal(PublicNullableAnnotation.Annotated, parameterSymbol.Type.NullableAnnotation); 3546Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol.Parameters[0].Type.NullableAnnotation); 3558Assert.Equal(PublicNullableAnnotation.Annotated, o1Symbol.Type.NullableAnnotation); 3569Assert.Equal(PublicNullableAnnotation.NotAnnotated, o2Symbol.Type.NullableAnnotation); 3607Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol.Parameters[0].Type.NullableAnnotation); 3619Assert.Equal(PublicNullableAnnotation.Annotated, o1Symbol.Type.NullableAnnotation); 3630Assert.Equal(PublicNullableAnnotation.NotAnnotated, o2Symbol.Type.NullableAnnotation); 3921Assert.Equal(PublicNullableAnnotation.NotAnnotated, o1Symbol.Type.NullableAnnotation); 3923Assert.Equal(PublicNullableAnnotation.Annotated, o2Symbol.Type.NullableAnnotation); 3935Assert.Equal(PublicNullableAnnotation.NotAnnotated, o3Symbol.Type.NullableAnnotation); 3937Assert.Equal(PublicNullableAnnotation.Annotated, o4Symbol.Type.NullableAnnotation); 3985Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[0].Type.NullableAnnotation); 3987Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[1].Type.NullableAnnotation); 3989Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol1.Parameters[2].Type.NullableAnnotation); 3995Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[0].Type.NullableAnnotation); 3997Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[1].Type.NullableAnnotation); 3999Assert.Equal(PublicNullableAnnotation.NotAnnotated, innerLambdaSymbol2.Parameters[2].Type.NullableAnnotation); 4372Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4400Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4430Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4460Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4490Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4522Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4555Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4583Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4613Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4644Assert.Equal(PublicNullableAnnotation.NotAnnotated, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4677Assert.Equal(PublicNullableAnnotation.None, ((ITypeSymbol)symbol2.Symbol).NullableAnnotation); 4703Assert.Equal(PublicNullableAnnotation.NotAnnotated, symbol2.Parameters.Single().Type.NullableAnnotation); 4781var actualAnnotations = invocations.Select(inv => (((IMethodSymbol)model.GetSymbolInfo(inv).Symbol)).TypeArguments[0].NullableAnnotation).ToArray(); 4821Assert.Equal(PublicNullableAnnotation.NotAnnotated, info.Type.NullableAnnotation); 4826Assert.Equal(PublicNullableAnnotation.NotAnnotated, info.Type.NullableAnnotation); 4916Assert.Equal(PublicNullableAnnotation.NotAnnotated, typeInfo.Type.NullableAnnotation); 5201Assert.Equal(expectedAnnotation, typeInfo.Type.NullableAnnotation); 5236Assert.Equal(PublicNullableAnnotation.None, typeInfo.Type.NullableAnnotation); 5259Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5282Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5314Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5337Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5359Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5407Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation); 5464Assert.Equal(PublicNullableAnnotation.NotAnnotated, type.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CompilationTestUtils.cs (6)
363Assert.Equal(typeInfo.Type.NullableAnnotation, iop.Type.NullableAnnotation); 387Assert.Equal(typeInfo.ConvertedType.NullableAnnotation, iop.Type.NullableAnnotation); 428Assert.True(iop.Type?.NullableAnnotation == typeInfo.ConvertedType?.NullableAnnotation);
Extensions.cs (2)
874return type.TypeArguments.Select(t => t.NullableAnnotation); 879return method.TypeArguments.Select(t => t.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
59var additionalAnnotation = type.NullableAnnotation switch 64_ => throw ExceptionUtilities.UnexpectedValue(type.NullableAnnotation),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (5)
68if (underlyingType.NullableAnnotation == NullableAnnotation.Annotated) 102if (symbol.NullableAnnotation == NullableAnnotation.Annotated) 113return symbol.NullableAnnotation is NullableAnnotation.Annotated 308if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 363if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Utilities\SymbolEquivalenceComparerTests.cs (8)
1355Assert.Equal(NullableAnnotation.Annotated, a1.NullableAnnotation); 1356Assert.Equal(NullableAnnotation.NotAnnotated, a2.NullableAnnotation); 1419Assert.Equal(NullableAnnotation.None, a1.NullableAnnotation); 1420Assert.Equal(NullableAnnotation.NotAnnotated, a2.NullableAnnotation); 1482Assert.Equal(NullableAnnotation.None, a1.NullableAnnotation); 1483Assert.Equal(NullableAnnotation.Annotated, a2.NullableAnnotation); 1545Assert.Equal(NullableAnnotation.None, a1.NullableAnnotation); 1546Assert.Equal(NullableAnnotation.Annotated, a2.NullableAnnotation);
Microsoft.CodeAnalysis.Features (3)
ExtractMethod\Extensions.cs (1)
44return (T)typeSymbol.WithNullableAnnotation(symbol.NullableAnnotation);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
250if (parameter.Type.NullableAnnotation == NullableAnnotation.Annotated)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
483if (symbol.NullableAnnotation == NullableAnnotation.Annotated)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
772Private ReadOnly Property ITypeSymbol_NullableAnnotation As NullableAnnotation Implements ITypeSymbol.NullableAnnotation
Microsoft.CodeAnalysis.Workspaces (16)
Editing\SyntaxGenerator.cs (1)
248return Equals(current, typeParameter) && current.NullableAnnotation == NullableAnnotation.Annotated;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
34var isNonNullableReferenceType = type.IsReferenceType && type.NullableAnnotation != NullableAnnotation.Annotated; 730=> type.WithNullableAnnotation(symbolForNullableAnnotation.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
92return _typeGenerator.Construct(symbol.OriginalDefinition, [.. substitutedArguments]).WithNullableAnnotation(symbol.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
99if (x.NullableAnnotation == y.NullableAnnotation) 103return (x.NullableAnnotation, y.NullableAnnotation) switch
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
54=> _symbolEquivalenceComparer._ignoreNullableAnnotations ? 0 : ((int)type.NullableAnnotation).GetHashCode();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
31namedType.NullableAnnotation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (3)
62public NullableAnnotation ReceiverNullableAnnotation => ReceiverType.NullableAnnotation; 63public NullableAnnotation ReturnNullableAnnotation => ReturnType.NullableAnnotation; 64public ImmutableArray<NullableAnnotation> TypeArgumentNullableAnnotations => TypeArguments.SelectAsArray(a => a.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
33public override ImmutableArray<NullableAnnotation> TypeArgumentNullableAnnotations => _typeArguments.SelectAsArray(t => t.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
120typeParameter.NullableAnnotation,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (1)
103if (foreachInfo.ElementType != null && foreachInfo.ElementType.NullableAnnotation != NullableAnnotation.NotAnnotated)
Microsoft.Extensions.Options.SourceGeneration (3)
Parser.cs (3)
418enumeratedIsNullable = enumeratedType.IsReferenceType || enumeratedType.NullableAnnotation == NullableAnnotation.Annotated; 420enumeratedMayBeNull = enumeratedType.NullableAnnotation == NullableAnnotation.Annotated; 588memberType.IsReferenceType || memberType.NullableAnnotation == NullableAnnotation.Annotated,
Microsoft.Gen.Logging (6)
Parsing\Parser.cs (3)
584IsNullable = paramTypeSymbol.NullableAnnotation == NullableAnnotation.Annotated, 677isNullable = typeSymbol.NullableAnnotation == NullableAnnotation.Annotated; 731isNullable = parameter.Type.NullableAnnotation == NullableAnnotation.Annotated;
Parsing\Parser.LogProperties.cs (1)
203IsNullable = property.Type.NullableAnnotation == NullableAnnotation.Annotated,
Parsing\Parser.TagProvider.cs (2)
153if (type.NullableAnnotation == NullableAnnotation.Annotated) 155if (target.NullableAnnotation == NullableAnnotation.NotAnnotated)
Microsoft.Maui.Controls.BindingSourceGen (1)
ITypeSymbolExtensions.cs (1)
33 typeInfo.IsReferenceType && typeInfo.NullableAnnotation == NullableAnnotation.Annotated;
System.Text.Json.SourceGeneration (3)
Helpers\RoslynExtensions.cs (3)
48if (type.NullableAnnotation is NullableAnnotation.Annotated) 352return returnType.NullableAnnotation is NullableAnnotation.NotAnnotated; 374return inputType.NullableAnnotation is NullableAnnotation.NotAnnotated;