417 references to Annotated
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
370
loggerType = gen.TypeExpression(t.WithNullableAnnotation(NullableAnnotation.
Annotated
));
Microsoft.AspNetCore.App.Analyzers (2)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
167
NullableAnnotation: NullableAnnotation.
Annotated
173
NullableAnnotation: NullableAnnotation.
Annotated
Microsoft.AspNetCore.Http.RequestDelegateGenerator (8)
src\Shared\RoslynUtils\SymbolExtensions.cs (2)
167
NullableAnnotation: NullableAnnotation.
Annotated
173
NullableAnnotation: NullableAnnotation.
Annotated
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (3)
115
if (endpointParameter.ElementType.NullableAnnotation == NullableAnnotation.
Annotated
)
137
if (endpointParameter.IsOptional || endpointParameter.Type.NullableAnnotation == NullableAnnotation.
Annotated
)
177
if (parameter.IsArray && parameter.ElementType.NullableAnnotation == NullableAnnotation.
Annotated
)
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (3)
40
var isOptional = p.IsOptional || type.NullableAnnotation == NullableAnnotation.
Annotated
;
92
if (endpoint.Response.IsAwaitable && endpoint.Response.WrappedResponseType.NullableAnnotation == NullableAnnotation.
Annotated
)
425
if (endpoint.Response?.WrappedResponseType.NullableAnnotation == NullableAnnotation.
Annotated
)
Microsoft.CodeAnalysis (1)
Symbols\NullableFlowState.cs (1)
40
return CodeAnalysis.NullableAnnotation.
Annotated
;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
34
var isNonNullableReferenceType = type.IsReferenceType && type.NullableAnnotation != NullableAnnotation.
Annotated
;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
60
parameters: [CodeGenerationSymbolFactory.CreateParameterSymbol(compilation.GetSpecialType(SpecialType.System_Object).WithNullableAnnotation(NullableAnnotation.
Annotated
), ObjName)],
Microsoft.CodeAnalysis.CSharp (8)
BoundTree\BoundNode.cs (2)
247
CodeAnalysis.NullableAnnotation.
Annotated
=> BoundNodeAttributes.TopLevelAnnotated,
284
BoundNodeAttributes.TopLevelAnnotated => CodeAnalysis.NullableAnnotation.
Annotated
,
SymbolDisplay\SymbolDisplayVisitor.Types.cs (3)
74
AddPunctuation(type.NullableAnnotation == CodeAnalysis.NullableAnnotation.
Annotated
? SyntaxKind.QuestionToken : SyntaxKind.ExclamationToken);
82
case CodeAnalysis.NullableAnnotation.
Annotated
:
874
case CodeAnalysis.NullableAnnotation.
Annotated
:
Symbols\NullableAnnotationExtensions.cs (2)
131
NullableAnnotation.Annotated => CodeAnalysis.NullableAnnotation.
Annotated
,
153
CodeAnalysis.NullableAnnotation.
Annotated
=> CSharp.NullableAnnotation.Annotated,
Symbols\PublicModel\TypeParameterSymbol.cs (1)
40
true => CodeAnalysis.NullableAnnotation.
Annotated
,
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
238
if (localSymbol.Type.NullableAnnotation == NullableAnnotation.
Annotated
)
254
if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.
Annotated
})
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
413
property.Type.NullableAnnotation == NullableAnnotation.
Annotated
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
150
if (typeSymbol.NullableAnnotation == NullableAnnotation.
Annotated
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
225
.Where(tp => tp.NullableAnnotation == NullableAnnotation.
Annotated
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
62
NullableAnnotation.
Annotated
=> NullableSyntaxAnnotationEx.AnnotatedOrNotAnnotated,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (5)
68
if (underlyingType.NullableAnnotation == NullableAnnotation.
Annotated
)
102
if (symbol.NullableAnnotation == NullableAnnotation.
Annotated
)
113
return symbol.NullableAnnotation is NullableAnnotation.
Annotated
308
if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.
Annotated
})
363
if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.
Annotated
})
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1113
return CreateResult(SpecialType.System_Object, NullableAnnotation.
Annotated
);
1138
return symbol.WithNullableAnnotation(NullableAnnotation.
Annotated
);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (9)
CodeGen\CodeGenLocalFunctionTests.cs (2)
5363
Assert.Equal(NullableAnnotation.
Annotated
, localFn1.ReturnTypeWithAnnotations.NullableAnnotation);
5367
Assert.Equal(NullableAnnotation.
Annotated
, param.TypeWithAnnotations.NullableAnnotation);
CodeGen\CodeGenTupleTest.cs (7)
6813
elementNullableAnnotations: ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.
Annotated
));
6820
elementNullableAnnotations: ImmutableArray.Create(CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.None));
6849
tuple2 = comp.CreateTupleTypeSymbol(underlyingType, elementNullableAnnotations: CreateAnnotations(CodeAnalysis.NullableAnnotation.
Annotated
, 9));
6882
elementNullableAnnotations: ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.
Annotated
));
6889
elementNullableAnnotations: ImmutableArray.Create(CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.None));
6918
tuple2 = comp.CreateTupleTypeSymbol(elementTypes, elementNullableAnnotations: CreateAnnotations(CodeAnalysis.NullableAnnotation.
Annotated
, 9));
29006
var nullableObject = TypeWithAnnotations.Create(@object, NullableAnnotation.
Annotated
);
Microsoft.CodeAnalysis.CSharp.Features (6)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.CompletionSymbolDisplay.cs (1)
122
if (symbol.NullableAnnotation == NullableAnnotation.
Annotated
)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
711
if (methodSymbol.ReturnType.NullableAnnotation != NullableAnnotation.
Annotated
)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (2)
238
if (localSymbol.Type.NullableAnnotation == NullableAnnotation.
Annotated
)
254
if (rightType.Type is null or { NullableAnnotation: NullableAnnotation.
Annotated
})
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (1)
413
property.Type.NullableAnnotation == NullableAnnotation.
Annotated
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
150
if (typeSymbol.NullableAnnotation == NullableAnnotation.
Annotated
)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IConversionExpression.cs (1)
5294
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, iopTree.Value.Type.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (121)
Semantics\DelegateTypeTests.cs (2)
15562
var funcOfObjectNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(objectType, NullableAnnotation.
Annotated
)));
15563
var funcOfStringNullable = funcOfT.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(stringType, NullableAnnotation.
Annotated
)));
Semantics\NativeIntegerTests.cs (1)
1628
Assert.Same(underlyingType, ((INamedTypeSymbol)type.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
)).NativeIntegerUnderlyingType);
Semantics\NullableReferenceTypesTests.cs (118)
5173
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
5174
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
11181
verify("C1.F2", "System.String?", NullableAnnotation.
Annotated
);
11183
verify("C1.F4", "System.Int32?", NullableAnnotation.
Annotated
);
11184
verify("C1.F5", "System.Int32?", NullableAnnotation.
Annotated
);
11186
verify("C2.F2", "System.String?", NullableAnnotation.
Annotated
);
11188
verify("C2.F4", "System.Int32?", NullableAnnotation.
Annotated
);
11189
verify("C2.F5", "System.Int32?", NullableAnnotation.
Annotated
);
11191
verify("C3.F2", "System.String?", NullableAnnotation.
Annotated
);
11193
verify("C3.F4", "System.Int32?", NullableAnnotation.
Annotated
);
11194
verify("C3.F5", "System.Int32?", NullableAnnotation.
Annotated
);
11277
verify("C1.F2", "T?", NullableAnnotation.
Annotated
);
11279
verify("C1.F4", "T?", NullableAnnotation.
Annotated
);
11281
verify("C1.F6", "T?", NullableAnnotation.
Annotated
);
11282
verify("C1.F7", "T?", NullableAnnotation.
Annotated
);
11284
verify("C2.F2", "T?", NullableAnnotation.
Annotated
);
11286
verify("C2.F4", "T?", NullableAnnotation.
Annotated
);
11288
verify("C2.F6", "T?", NullableAnnotation.
Annotated
);
11289
verify("C2.F7", "T?", NullableAnnotation.
Annotated
);
11291
verify("C3.F2", "T?", NullableAnnotation.
Annotated
);
11293
verify("C3.F4", "T?", NullableAnnotation.
Annotated
);
11295
verify("C3.F6", "T?", NullableAnnotation.
Annotated
);
11296
verify("C3.F7", "T?", NullableAnnotation.
Annotated
);
12100
Assert.Equal(NullableAnnotation.
Annotated
, m1.Parameters[0].TypeWithAnnotations.NullableAnnotation);
13899
Assert.Equal(NullableAnnotation.
Annotated
, m1.Parameters[0].TypeWithAnnotations.NullableAnnotation);
13905
Assert.Equal(NullableAnnotation.
Annotated
, m2.ReturnTypeWithAnnotations.NullableAnnotation);
59020
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59024
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, model.GetTypeInfo(declaration.Type).Nullability.Annotation);
59026
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, model.GetTypeInfo(declaration.Type).ConvertedNullability.Annotation);
59082
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59114
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59143
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59176
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59208
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59241
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59275
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59302
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59332
Assert.Equal(NullableAnnotation.
Annotated
, type.NullableAnnotation);
59360
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59364
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
59368
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
62847
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
71255
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71291
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71294
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71332
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71335
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71369
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71372
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71441
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71444
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71514
Assert.Equal(NullableAnnotation.
Annotated
, symbol.TypeWithAnnotations.NullableAnnotation);
71879
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, model.GetTypeInfo(discard1).Nullability.Annotation);
71884
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, model.GetTypeInfo(discard2).Nullability.Annotation);
113113
m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.
Annotated
))),
113120
m1.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(a, NullableAnnotation.
Annotated
))),
115807
var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
115837
var i1 = iDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
115858
var i2b = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(iDefinition.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
115863
var i2c = i2.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i2.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
115867
var c3 = cDefinition.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(cDefinition.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
115872
var i3b = i3.Construct(ImmutableArray.Create(TypeWithAnnotations.Create(i3.TypeParameters.Single(), NullableAnnotation.
Annotated
)));
126840
var inputs = new[] { NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated };
126845
{ NullableAnnotation.
Annotated
, NullableAnnotation.
Annotated
, NullableAnnotation.
Annotated
},
126846
{ NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.Oblivious },
126847
{ NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated },
126872
var inputs = new[] { NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated };
126877
{ NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated },
126903
var inputs = new[] { NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated };
126908
{ NullableAnnotation.
Annotated
, NullableAnnotation.
Annotated
, NullableAnnotation.NotAnnotated },
126909
{ NullableAnnotation.
Annotated
, NullableAnnotation.Oblivious, NullableAnnotation.NotAnnotated },
139422
Assert.True(dGoo.Parameters[0].TypeWithAnnotations.NullableAnnotation == NullableAnnotation.
Annotated
);
139450
Assert.Equal(NullableAnnotation.
Annotated
, c2Goo.Parameters[0].TypeWithAnnotations.NullableAnnotation);
139478
Assert.Equal(NullableAnnotation.
Annotated
, ((ArrayTypeSymbol)c2Goo.Parameters[0].Type).ElementTypeWithAnnotations.NullableAnnotation);
139510
Assert.Equal(NullableAnnotation.
Annotated
, tuple.TupleElements[1].TypeWithAnnotations.NullableAnnotation);
139538
Assert.Equal(NullableAnnotation.
Annotated
, c2Goo.ReturnTypeWithAnnotations.NullableAnnotation);
139566
Assert.Equal(NullableAnnotation.
Annotated
, ((ArrayTypeSymbol)c2Goo.ReturnType).ElementTypeWithAnnotations.NullableAnnotation);
139598
Assert.Equal(NullableAnnotation.
Annotated
, tuple.TupleElements[1].TypeWithAnnotations.NullableAnnotation);
139621
Assert.Equal(NullableAnnotation.
Annotated
, dGoo.Parameters[0].TypeWithAnnotations.NullableAnnotation);
139644
Assert.Equal(NullableAnnotation.
Annotated
, ((ArrayTypeSymbol)dGoo.Parameters[0].Type).ElementTypeWithAnnotations.NullableAnnotation);
139671
Assert.Equal(NullableAnnotation.
Annotated
, tuple.TupleElements[1].TypeWithAnnotations.NullableAnnotation);
139694
Assert.Equal(NullableAnnotation.
Annotated
, dGoo.ReturnTypeWithAnnotations.NullableAnnotation);
139717
Assert.Equal(NullableAnnotation.
Annotated
, ((ArrayTypeSymbol)dGoo.ReturnType).ElementTypeWithAnnotations.NullableAnnotation);
139744
Assert.Equal(NullableAnnotation.
Annotated
, tuple.TupleElements[1].TypeWithAnnotations.NullableAnnotation);
139769
Assert.Equal(NullableAnnotation.
Annotated
, dGoo.ReturnTypeWithAnnotations.NullableAnnotation);
139775
Assert.Equal(NullableAnnotation.
Annotated
, tuple.TupleElements[0].TypeWithAnnotations.NullableAnnotation);
145379
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145380
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145420
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145421
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145460
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145461
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145498
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145499
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145536
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145537
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145640
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145641
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
145679
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.NullableAnnotation);
145680
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
146472
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
149969
Assert.Equal(NullableAnnotation.
Annotated
, parameterType.NullableAnnotation);
154803
VerifyVariableAnnotation(model, locals[0], "T? t1", NullableAnnotation.
Annotated
);
154804
VerifyVariableAnnotation(model, locals[1], "T? t2", NullableAnnotation.
Annotated
);
154805
VerifyVariableAnnotation(model, locals[2], "T? t3", NullableAnnotation.
Annotated
);
154806
VerifyVariableAnnotation(model, locals[3], "T? t4", NullableAnnotation.
Annotated
);
154807
VerifyVariableAnnotation(model, locals[4], "T? t5", NullableAnnotation.
Annotated
);
154872
VerifyVariableAnnotation(model, locals[0], "T? y1", NullableAnnotation.
Annotated
);
154873
VerifyVariableAnnotation(model, locals[1], "T? y2", NullableAnnotation.
Annotated
);
154874
VerifyVariableAnnotation(model, locals[2], "T? y3", NullableAnnotation.
Annotated
);
154875
VerifyVariableAnnotation(model, locals[3], "T? y4", NullableAnnotation.
Annotated
);
154876
VerifyVariableAnnotation(model, locals[4], "U? y5", NullableAnnotation.
Annotated
);
154884
(expectedAnnotation == NullableAnnotation.
Annotated
) ? CodeAnalysis.NullableAnnotation.
Annotated
: CodeAnalysis.NullableAnnotation.NotAnnotated,
158820
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, local.Type.NullableAnnotation);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (209)
Compilation\CompilationAPITests.cs (12)
2500
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.
Annotated
).ElementNullableAnnotation);
2501
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, comp.CreateArrayTypeSymbol(elementType, elementNullableAnnotation: CodeAnalysis.NullableAnnotation.
Annotated
).ElementType.NullableAnnotation);
2707
type = comp.CreateAnonymousTypeSymbol(memberTypes, memberNames, memberNullableAnnotations: ImmutableArray.Create(CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.
Annotated
));
2709
AssertEx.Equal(new[] { CodeAnalysis.NullableAnnotation.NotAnnotated, CodeAnalysis.NullableAnnotation.
Annotated
}, GetAnonymousTypeNullableAnnotations(type));
3045
type = genericType.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated));
3047
AssertEx.Equal(new[] { CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated }, type.TypeArgumentNullableAnnotations);
3048
AssertEx.Equal(new[] { CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated }, type.TypeArgumentNullableAnnotations());
3080
type = genericMethod.Construct(typeArguments, ImmutableArray.Create(CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated));
3082
AssertEx.Equal(new[] { CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated }, type.TypeArgumentNullableAnnotations);
3083
AssertEx.Equal(new[] { CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableAnnotation.NotAnnotated }, type.TypeArgumentNullableAnnotations());
Compilation\TypeInfoTests.cs (17)
23
var nullable = new NullabilityInfo(CodeAnalysis.NullableAnnotation.
Annotated
, CodeAnalysis.NullableFlowState.MaybeNull);
27
EqualityTesting.AssertEqual(new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32, nullable, notNullable),
28
new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32, nullable, notNullable));
30
EqualityTesting.AssertNotEqual(new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable),
31
new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable));
33
EqualityTesting.AssertNotEqual(new TypeInfo(int32.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable),
34
new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable));
36
EqualityTesting.AssertNotEqual(new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable),
37
new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.NotAnnotated), int32.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), notNullable, nullable));
39
EqualityTesting.AssertNotEqual(new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), nullable, nullable),
40
new TypeInfo(obj.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
), int32, nullable, notNullable));
Symbols\FunctionPointerTypeSymbolTests.cs (1)
1570
ImmutableArray.Create(c.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.NotAnnotated), c.WithNullableAnnotation(CodeAnalysis.NullableAnnotation.
Annotated
)),
Symbols\PartialPropertiesTests.cs (1)
1684
Assert.Equal(NullableAnnotation.
Annotated
, p2.TypeWithAnnotations.NullableAnnotation);
Symbols\Source\NullablePublicAPITests.cs (176)
58
Assert.Equal(PublicNullableAnnotation.
Annotated
, arrayTypes[0].ElementNullableAnnotation);
59
Assert.Equal(PublicNullableAnnotation.
Annotated
, arrayTypes[0].ElementType.NullableAnnotation);
94
Assert.Equal(PublicNullableAnnotation.
Annotated
, expressionTypes[1].TypeArgumentNullableAnnotations.Single());
95
Assert.Equal(PublicNullableAnnotation.
Annotated
, expressionTypes[1].TypeArgumentNullableAnnotations().Single());
157
PublicNullableAnnotation.
Annotated
,
159
PublicNullableAnnotation.
Annotated
,
161
PublicNullableAnnotation.
Annotated
,
163
PublicNullableAnnotation.
Annotated
);
224
PublicNullableAnnotation.
Annotated
,
226
PublicNullableAnnotation.
Annotated
,
228
PublicNullableAnnotation.
Annotated
,
230
PublicNullableAnnotation.
Annotated
);
298
PublicNullableAnnotation.
Annotated
,
300
PublicNullableAnnotation.
Annotated
,
302
PublicNullableAnnotation.
Annotated
,
304
PublicNullableAnnotation.
Annotated
);
388
PublicNullableAnnotation.
Annotated
,
389
PublicNullableAnnotation.
Annotated
,
392
PublicNullableAnnotation.
Annotated
,
393
PublicNullableAnnotation.
Annotated
);
491
PublicNullableAnnotation.
Annotated
,
493
PublicNullableAnnotation.
Annotated
,
495
PublicNullableAnnotation.
Annotated
,
497
PublicNullableAnnotation.
Annotated
);
584
PublicNullableAnnotation.
Annotated
,
586
PublicNullableAnnotation.
Annotated
,
588
PublicNullableAnnotation.
Annotated
,
590
PublicNullableAnnotation.
Annotated
);
647
PublicNullableAnnotation.
Annotated
,
649
PublicNullableAnnotation.
Annotated
);
703
PublicNullableAnnotation.
Annotated
,
705
PublicNullableAnnotation.
Annotated
,
707
PublicNullableAnnotation.
Annotated
,
709
PublicNullableAnnotation.
Annotated
);
767
PublicNullableAnnotation.
Annotated
,
769
PublicNullableAnnotation.
Annotated
,
772
PublicNullableAnnotation.
Annotated
,
774
PublicNullableAnnotation.
Annotated
);
832
PublicNullableAnnotation.
Annotated
,
834
PublicNullableAnnotation.
Annotated
,
836
PublicNullableAnnotation.
Annotated
,
838
PublicNullableAnnotation.
Annotated
);
900
PublicNullableAnnotation.
Annotated
,
902
PublicNullableAnnotation.
Annotated
,
905
PublicNullableAnnotation.
Annotated
,
907
PublicNullableAnnotation.
Annotated
);
957
PublicNullableAnnotation.
Annotated
,
959
PublicNullableAnnotation.
Annotated
,
962
PublicNullableAnnotation.
Annotated
,
964
PublicNullableAnnotation.
Annotated
1015
PublicNullableAnnotation.
Annotated
,
1017
PublicNullableAnnotation.
Annotated
,
1020
PublicNullableAnnotation.
Annotated
,
1022
PublicNullableAnnotation.
Annotated
1216
var nullable = new NullabilityInfo(PublicNullableAnnotation.
Annotated
, PublicNullableFlowState.MaybeNull);
1266
var @null = new NullabilityInfo(PublicNullableAnnotation.
Annotated
, PublicNullableFlowState.MaybeNull);
1631
Assert.Equal(PublicNullableAnnotation.
Annotated
, type.Nullability.Annotation);
1795
Assert.Equal(PublicNullableAnnotation.
Annotated
, info.Nullability.Annotation);
1854
verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.
Annotated
);
1897
verifySymbolInfo((IMethodSymbol)symbolInfo.Symbol, PublicNullableAnnotation.
Annotated
);
1949
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.NullableAnnotation);
1950
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.Type.NullableAnnotation);
1955
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
1956
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.ConvertedNullability.Annotation);
1989
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
1990
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2049
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2050
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2051
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2052
assertAnnotation(declarations[4], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2092
assertAnnotation(declarations[0], PublicNullableAnnotation.NotAnnotated, PublicNullableAnnotation.
Annotated
);
2093
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2094
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.
Annotated
);
2095
assertAnnotation(declarations[4], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.NotAnnotated);
2139
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).NullableAnnotation);
2140
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation);
2143
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).NullableAnnotation);
2144
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((ILocalSymbol)specModel.GetDeclaredSymbol(newDeclarator)).Type.NullableAnnotation);
2178
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2179
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2180
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2181
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2182
assertAnnotation(declarations[4], PublicNullableAnnotation.
Annotated
);
2183
assertAnnotation(declarations[5], PublicNullableAnnotation.
Annotated
);
2220
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.NullableAnnotation);
2221
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.Type.NullableAnnotation);
2250
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2251
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2252
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2253
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2284
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2285
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2296
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
2328
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2329
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2330
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2331
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2371
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2372
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2373
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2415
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2416
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2463
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.NullableAnnotation);
2464
Assert.Equal(PublicNullableAnnotation.
Annotated
, symbol.Type.NullableAnnotation);
2467
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
2468
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.ConvertedNullability.Annotation);
2469
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.Type.NullableAnnotation);
2470
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.ConvertedType.NullableAnnotation);
2503
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2506
assertAnnotation(declarations[3], PublicNullableAnnotation.
Annotated
);
2548
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2549
assertAnnotation(declarations[1], PublicNullableAnnotation.
Annotated
);
2550
assertAnnotation(declarations[2], PublicNullableAnnotation.
Annotated
);
2552
assertAnnotation(declarations[4], PublicNullableAnnotation.
Annotated
);
2554
assertAnnotation(declarations[6], PublicNullableAnnotation.
Annotated
);
2555
assertAnnotation(declarations[7], PublicNullableAnnotation.
Annotated
);
2569
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.Nullability.Annotation);
2570
Assert.Equal(CodeAnalysis.NullableAnnotation.
Annotated
, typeInfo.ConvertedNullability.Annotation);
2597
assertAnnotation(declarations[0], PublicNullableAnnotation.
Annotated
);
2740
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IPropertySymbol)symInfo.Symbol).NullableAnnotation);
2741
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IPropertySymbol)symInfo.Symbol).Type.NullableAnnotation);
2742
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]);
2743
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First());
2786
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IFieldSymbol)symInfo.Symbol).NullableAnnotation);
2787
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IFieldSymbol)symInfo.Symbol).Type.NullableAnnotation);
2788
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]);
2789
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First());
2829
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).NullableAnnotation);
2830
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation);
2831
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]);
2832
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First());
2834
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).NullableAnnotation);
2835
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation);
2878
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).NullableAnnotation);
2879
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation);
2880
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations[0]);
2881
Assert.Equal(PublicNullableAnnotation.
Annotated
, symInfo.Symbol.ContainingType.TypeArgumentNullableAnnotations().First());
2883
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).NullableAnnotation);
2884
Assert.Equal(PublicNullableAnnotation.
Annotated
, ((IEventSymbol)symInfo.Symbol).Type.NullableAnnotation);
2920
Assert.Equal(PublicNullableAnnotation.
Annotated
, typeInfo.Type.NullableAnnotation);
2959
verifyAnnotation(collectionInitializer.Expressions[0], PublicNullableAnnotation.
Annotated
);
3001
verifyAnnotation(collectionInitializer.Expressions[0], PublicNullableAnnotation.
Annotated
);
3043
verifyAnnotation(collectionInitializer.Expressions[0], PublicNullableAnnotation.
Annotated
);
3150
verifyAnnotation(collectionInitializer.Expressions[0], PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.NotAnnotated);
3151
verifyAnnotation(collectionInitializer.Expressions[1], PublicNullableAnnotation.NotAnnotated, PublicNullableAnnotation.
Annotated
);
3195
verifyAnnotation(collectionInitializer.Expressions[0], PublicNullableAnnotation.
Annotated
);
3196
verifyAnnotation(collectionInitializer.Expressions[1], PublicNullableAnnotation.
Annotated
);
3259
verifyAnnotation(indexers.Slice(0, 2), PublicNullableAnnotation.
Annotated
, PublicNullableAnnotation.NotAnnotated);
3260
verifyAnnotation(indexers.Slice(2, 2), PublicNullableAnnotation.NotAnnotated, PublicNullableAnnotation.
Annotated
);
3311
verifyAnnotation(elementAccesses.Slice(0, 2), PublicNullableAnnotation.
Annotated
);
3360
verifyAnnotation(elementAccesses[0], PublicNullableAnnotation.
Annotated
);
3406
verifyAnnotations(operators[0], PublicNullableAnnotation.
Annotated
, "S<T?> S<T?>.operator ~(S<T?> s)");
3451
verifyAnnotations(operators[0], PublicNullableAnnotation.
Annotated
, "S<T?> S<T?>.operator +(S<T?> x, S<T?> y)");
3492
Assert.Equal(PublicNullableAnnotation.
Annotated
, lambdaSymbol.Parameters[0].NullableAnnotation);
3493
Assert.Equal(PublicNullableAnnotation.
Annotated
, lambdaSymbol.Parameters[0].Type.NullableAnnotation);
3504
Assert.Equal(PublicNullableAnnotation.
Annotated
, parameterSymbol.NullableAnnotation);
3505
Assert.Equal(PublicNullableAnnotation.
Annotated
, parameterSymbol.Type.NullableAnnotation);
3557
Assert.Equal(PublicNullableAnnotation.
Annotated
, o1Symbol.NullableAnnotation);
3558
Assert.Equal(PublicNullableAnnotation.
Annotated
, o1Symbol.Type.NullableAnnotation);
3618
Assert.Equal(PublicNullableAnnotation.
Annotated
, o1Symbol.NullableAnnotation);
3619
Assert.Equal(PublicNullableAnnotation.
Annotated
, o1Symbol.Type.NullableAnnotation);
3922
Assert.Equal(PublicNullableAnnotation.
Annotated
, o2Symbol.NullableAnnotation);
3923
Assert.Equal(PublicNullableAnnotation.
Annotated
, o2Symbol.Type.NullableAnnotation);
3936
Assert.Equal(PublicNullableAnnotation.
Annotated
, o4Symbol.NullableAnnotation);
3937
Assert.Equal(PublicNullableAnnotation.
Annotated
, o4Symbol.Type.NullableAnnotation);
4336
verify(exprs[0], PublicNullableAnnotation.
Annotated
, PublicNullableFlowState.MaybeNull);
4337
verify(exprs[1], PublicNullableAnnotation.
Annotated
, PublicNullableFlowState.MaybeNull);
4784
PublicNullableAnnotation.
Annotated
,
4787
PublicNullableAnnotation.
Annotated
,
5190
test(SemanticModelOptions.None, expectedAnnotation: PublicNullableAnnotation.
Annotated
);
Symbols\Source\UpdatedContainingSymbolAndNullableAnntotationTests.cs (2)
43
var wrappedLocal1 = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.
Annotated
));
44
var wrappedLocal1a = UpdatedContainingSymbolAndNullableAnnotationLocal.CreateForTest(local1, m2, TypeWithAnnotations.Create(local1.Type, NullableAnnotation.
Annotated
));
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
225
.Where(tp => tp.NullableAnnotation == NullableAnnotation.
Annotated
)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
62
NullableAnnotation.
Annotated
=> NullableSyntaxAnnotationEx.AnnotatedOrNotAnnotated,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (5)
68
if (underlyingType.NullableAnnotation == NullableAnnotation.
Annotated
)
102
if (symbol.NullableAnnotation == NullableAnnotation.
Annotated
)
113
return symbol.NullableAnnotation is NullableAnnotation.
Annotated
308
if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.
Annotated
})
363
if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.
Annotated
})
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1113
return CreateResult(SpecialType.System_Object, NullableAnnotation.
Annotated
);
1138
return symbol.WithNullableAnnotation(NullableAnnotation.
Annotated
);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Utilities\SymbolEquivalenceComparerTests.cs (3)
1355
Assert.Equal(NullableAnnotation.
Annotated
, a1.NullableAnnotation);
1483
Assert.Equal(NullableAnnotation.
Annotated
, a2.NullableAnnotation);
1546
Assert.Equal(NullableAnnotation.
Annotated
, a2.NullableAnnotation);
Microsoft.CodeAnalysis.Features (5)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (3)
111
? equatableType.Construct(_containingType.WithNullableAnnotation(NullableAnnotation.
Annotated
))
134
CodeGenerationSymbolFactory.CreateParameterSymbol(_containingType.IsValueType ? _containingType : _containingType.WithNullableAnnotation(NullableAnnotation.
Annotated
), LeftName),
135
CodeGenerationSymbolFactory.CreateParameterSymbol(_containingType.IsValueType ? _containingType : _containingType.WithNullableAnnotation(NullableAnnotation.
Annotated
), RightName));
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
250
if (parameter.Type.NullableAnnotation == NullableAnnotation.
Annotated
)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
483
if (symbol.NullableAnnotation == NullableAnnotation.
Annotated
)
Microsoft.CodeAnalysis.UnitTests (5)
Symbols\NullabilityInfoTests.cs (5)
19
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.
Annotated
, NullableFlowState.NotNull),
20
new NullabilityInfo(NullableAnnotation.
Annotated
, NullableFlowState.NotNull),
23
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.
Annotated
, NullableFlowState.NotNull),
27
assertEqualsAndHashCode(new NullabilityInfo(NullableAnnotation.
Annotated
, NullableFlowState.MaybeNull),
28
new NullabilityInfo(NullableAnnotation.
Annotated
, NullableFlowState.NotNull),
Microsoft.CodeAnalysis.Workspaces (3)
Editing\SyntaxGenerator.cs (1)
248
return Equals(current, typeParameter) && current.NullableAnnotation == NullableAnnotation.
Annotated
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
34
var isNonNullableReferenceType = type.IsReferenceType && type.NullableAnnotation != NullableAnnotation.
Annotated
;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
60
parameters: [CodeGenerationSymbolFactory.CreateParameterSymbol(compilation.GetSpecialType(SpecialType.System_Object).WithNullableAnnotation(NullableAnnotation.
Annotated
), ObjName)],
Microsoft.Extensions.Options.SourceGeneration (3)
Parser.cs (3)
418
enumeratedIsNullable = enumeratedType.IsReferenceType || enumeratedType.NullableAnnotation == NullableAnnotation.
Annotated
;
420
enumeratedMayBeNull = enumeratedType.NullableAnnotation == NullableAnnotation.
Annotated
;
588
memberType.IsReferenceType || memberType.NullableAnnotation == NullableAnnotation.
Annotated
,
Microsoft.Gen.Logging (5)
Parsing\Parser.cs (3)
584
IsNullable = paramTypeSymbol.NullableAnnotation == NullableAnnotation.
Annotated
,
677
isNullable = typeSymbol.NullableAnnotation == NullableAnnotation.
Annotated
;
731
isNullable = parameter.Type.NullableAnnotation == NullableAnnotation.
Annotated
;
Parsing\Parser.LogProperties.cs (1)
203
IsNullable = property.Type.NullableAnnotation == NullableAnnotation.
Annotated
,
Parsing\Parser.TagProvider.cs (1)
153
if (type.NullableAnnotation == NullableAnnotation.
Annotated
)
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
48
if (type.NullableAnnotation is NullableAnnotation.
Annotated
)
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Parser.cs (2)
124
nullableRegex = regexMethodSymbol.ReturnNullableAnnotation == NullableAnnotation.
Annotated
;
138
nullableRegex = regexPropertySymbol.NullableAnnotation == NullableAnnotation.
Annotated
;