5 implementations of WithNullableAnnotation
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
90public ITypeSymbol WithNullableAnnotation(NullableAnnotation nullableAnnotation)
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
27ITypeSymbol ITypeSymbol.WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation)
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
153ITypeSymbol ITypeSymbol.WithNullableAnnotation(NullableAnnotation nullableAnnotation)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
778Private Function ITypeSymbol_WithNullability(nullableAnnotation As NullableAnnotation) As ITypeSymbol Implements ITypeSymbol.WithNullableAnnotation
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
90public ITypeSymbol WithNullableAnnotation(NullableAnnotation nullableAnnotation)
66 references to WithNullableAnnotation
ConfigurationSchemaGenerator (5)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (3)
87ITypeSymbol? type = ResolveType(instanceArg.Value)?.WithNullableAnnotation(NullableAnnotation.None); 155type = targetMethod.TypeArguments[0].WithNullableAnnotation(NullableAnnotation.None); 205type = targetMethod.TypeArguments[0].WithNullableAnnotation(NullableAnnotation.None);
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (1)
28ITypeSymbol? typeSymbol = targetMethod.TypeArguments[0].WithNullableAnnotation(NullableAnnotation.None);
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (1)
72ITypeSymbol? typeSymbol = targetMethod.TypeArguments[0].WithNullableAnnotation(NullableAnnotation.None);
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
370loggerType = gen.TypeExpression(t.WithNullableAnnotation(NullableAnnotation.Annotated));
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
449.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation)); 454types = types.Concat((method.ReturnType ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(method.ReturnNullableAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
730=> type.WithNullableAnnotation(symbolForNullableAnnotation.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
92return _typeGenerator.Construct(symbol.OriginalDefinition, substitutedArguments.ToArray()).WithNullableAnnotation(symbol.NullableAnnotation);
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
60parameters: [CodeGenerationSymbolFactory.CreateParameterSymbol(compilation.GetSpecialType(SpecialType.System_Object).WithNullableAnnotation(NullableAnnotation.Annotated), ObjName)],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
84=> CreateResult(Compilation.GetSpecialType(type).WithNullableAnnotation(nullableAnnotation));
Microsoft.CodeAnalysis.CSharp (4)
SymbolDisplay\SymbolDisplay.cs (4)
55symbol = symbol.WithNullableAnnotation(nullableAnnotation); 120symbol = symbol.WithNullableAnnotation(nullableAnnotation); 166symbol.WithNullableAnnotation(nullableAnnotation), semanticModelOpt: null, positionOpt: -1, format: format, minimal: false); 213return ToDisplayParts(symbol.WithNullableAnnotation(nullableAnnotation), semanticModel, position, format, minimal: true);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
158return typeSymbol.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
144var localType = local.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated); 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1138return symbol.WithNullableAnnotation(NullableAnnotation.Annotated);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (2)
10=> typeInfo.ConvertedType?.WithNullableAnnotation(typeInfo.ConvertedNullability.Annotation); 13=> typeInfo.Type?.WithNullableAnnotation(typeInfo.Nullability.Annotation);
Microsoft.CodeAnalysis.CSharp.Features (6)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
350return type.WithNullableAnnotation(NullableAnnotation.NotAnnotated) as INamedTypeSymbol;
Completion\CompletionProviders\ObjectCreationCompletionProvider.cs (1)
94symbol = typeSymbol.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
777var newType = methodSymbol.ReturnType.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
158return typeSymbol.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (2)
144var localType = local.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated); 145var asType = asExpressionTypeInfo.Type.WithNullableAnnotation(NullableAnnotation.NotAnnotated);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\NativeIntegerTests.cs (3)
1627Assert.Same(underlyingType, ((INamedTypeSymbol)type.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None)).NativeIntegerUnderlyingType); 1628Assert.Same(underlyingType, ((INamedTypeSymbol)type.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.Annotated)).NativeIntegerUnderlyingType); 1629Assert.Same(underlyingType, ((INamedTypeSymbol)type.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.NotAnnotated)).NativeIntegerUnderlyingType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (11)
Symbols\FunctionPointerTypeSymbolTests.cs (3)
1568c.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), 1570ImmutableArray.Create(c.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.NotAnnotated), c.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.Annotated)),
Symbols\SymbolEqualityTests.cs (8)
252VerifyEquality(type1.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), type2.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), 260VerifyEquality(type1, type2.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), 264VerifyEquality(type1.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), type2, 488VerifyEquality(type1.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), type2.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), 496VerifyEquality(type1, type2.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), 500VerifyEquality(type1.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.None), type2,
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1138return symbol.WithNullableAnnotation(NullableAnnotation.Annotated);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\NullableHelpers\NullableExtensions.cs (2)
10=> typeInfo.ConvertedType?.WithNullableAnnotation(typeInfo.ConvertedNullability.Annotation); 13=> typeInfo.Type?.WithNullableAnnotation(typeInfo.Nullability.Annotation);
Microsoft.CodeAnalysis.Features (3)
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
47newOverriddenMember = CodeGenerationSymbolFactory.CreateMethodSymbol(methodSymbol, returnType: methodSymbol.ReturnType.WithNullableAnnotation(NullableAnnotation.NotAnnotated));
ExtractMethod\Extensions.cs (1)
44return (T)typeSymbol.WithNullableAnnotation(symbol.NullableAnnotation);
GenerateType\AbstractGenerateTypeService.State.cs (1)
263BaseTypeOrInterfaceOpt = (INamedTypeSymbol)baseType.WithNullableAnnotation(NullableAnnotation.None);
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
778Private Function ITypeSymbol_WithNullability(nullableAnnotation As NullableAnnotation) As ITypeSymbol Implements ITypeSymbol.WithNullableAnnotation
Microsoft.CodeAnalysis.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
449.Select(p => (p.Type ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(p.NullableAnnotation)); 454types = types.Concat((method.ReturnType ?? compilation.GetSpecialType(SpecialType.System_Object)).WithNullableAnnotation(method.ReturnNullableAnnotation));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
730=> type.WithNullableAnnotation(symbolForNullableAnnotation.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
92return _typeGenerator.Construct(symbol.OriginalDefinition, substitutedArguments.ToArray()).WithNullableAnnotation(symbol.NullableAnnotation);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
60parameters: [CodeGenerationSymbolFactory.CreateParameterSymbol(compilation.GetSpecialType(SpecialType.System_Object).WithNullableAnnotation(NullableAnnotation.Annotated), ObjName)],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
84=> CreateResult(Compilation.GetSpecialType(type).WithNullableAnnotation(nullableAnnotation));
Microsoft.Extensions.Options.SourceGeneration (6)
Parser.cs (6)
90_ = _visitedModelTypes.Add(modelType.WithNullableAnnotation(NullableAnnotation.None)); 392else if (!_visitedModelTypes.Add(memberType.WithNullableAnnotation(NullableAnnotation.None))) 406_ = _visitedModelTypes.Remove(memberType.WithNullableAnnotation(NullableAnnotation.None)); 455else if (!_visitedModelTypes.Add(enumeratedType.WithNullableAnnotation(NullableAnnotation.None))) 469_ = _visitedModelTypes.Remove(enumeratedType.WithNullableAnnotation(NullableAnnotation.None)); 686var mt = modelType.WithNullableAnnotation(NullableAnnotation.None);
Microsoft.Gen.Logging (4)
Parsing\Parser.TagProvider.cs (4)
163if (SymbolEqualityComparer.Default.Equals(type.WithNullableAnnotation(NullableAnnotation.None), target.WithNullableAnnotation(NullableAnnotation.None))) 170if (SymbolEqualityComparer.Default.Equals(target.WithNullableAnnotation(NullableAnnotation.None), iface.WithNullableAnnotation(NullableAnnotation.None)))
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
50type = type.WithNullableAnnotation(NullableAnnotation.None);