363 references to FlowAnalysisAnnotations
Microsoft.CodeAnalysis.CSharp (363)
FlowAnalysis\NullableWalker.cs (172)
765var annotations = usesFieldKeyword ? field!.FlowAnalysisAnnotations : symbol.GetFlowAnalysisAnnotations(); 766if ((annotations & FlowAnalysisAnnotations.AllowNull) != 0) 784var badState = symbolType.Type.IsPossiblyNullableReferenceTypeTypeParameter() && (annotations & FlowAnalysisAnnotations.NotNull) == 0 1023var symbolAnnotations = property is SourcePropertySymbolBase { UsesFieldKeyword: true, BackingField: { } field } 1032var overriddenAnnotations = overriddenProperty.GetFlowAnalysisAnnotations(); 1267var annotations = parameter.FlowAnalysisAnnotations; 1268var hasNotNull = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 1329FlowAnalysisAnnotations annotations = parameter.FlowAnalysisAnnotations; 1332bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenTrue; 1333bool hasMaybeNullWhenFalse = (annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNullWhenFalse; 1340bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenFalse; 1341bool hasMaybeNullWhenTrue = (annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNullWhenTrue; 1384((method.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) == FlowAnalysisAnnotations.DoesNotReturn) && 2320/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(TypeWithState, FlowAnalysisAnnotations)"/> 2433FlowAnalysisAnnotations overriddenAnnotations, 2435FlowAnalysisAnnotations overridingAnnotations, 2461bool overridingHasNotNull = (overridingAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 2462bool overriddenHasNotNull = (overriddenAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 2469bool overridingHasMaybeNull = (overridingAnnotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNull; 2470bool overriddenHasMaybeNull = (overriddenAnnotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNull; 2495var destAnnotationsWhen = ToInwardAnnotations(makeUnconditionalAnnotation(overriddenAnnotations, sense)); 2505static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2523static FlowAnalysisAnnotations makeUnconditionalAnnotation(FlowAnalysisAnnotations annotations, bool sense) 2527var unconditionalAnnotationWhenTrue = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenTrue, FlowAnalysisAnnotations.NotNull); 2528return makeUnconditionalAnnotationCore(unconditionalAnnotationWhenTrue, FlowAnalysisAnnotations.MaybeNullWhenTrue, FlowAnalysisAnnotations.MaybeNull); 2531var unconditionalAnnotationWhenFalse = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenFalse, FlowAnalysisAnnotations.NotNull); 2532return makeUnconditionalAnnotationCore(unconditionalAnnotationWhenFalse, FlowAnalysisAnnotations.MaybeNullWhenFalse, FlowAnalysisAnnotations.MaybeNull); 2536static FlowAnalysisAnnotations makeUnconditionalAnnotationCore(FlowAnalysisAnnotations annotations, FlowAnalysisAnnotations conditionalAnnotation, FlowAnalysisAnnotations replacementAnnotation) 2907var parameterAnnotations = GetParameterAnnotations(parameter); 2924internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 2926if ((parameterAnnotations & FlowAnalysisAnnotations.AllowNull) != 0) 2931if ((parameterAnnotations & FlowAnalysisAnnotations.DisallowNull) != 0) 2954TryGetReturnType(out TypeWithAnnotations returnType, out FlowAnalysisAnnotations returnAnnotations)) 3034private bool TryGetReturnType(out TypeWithAnnotations type, out FlowAnalysisAnnotations annotations) 3040annotations = FlowAnalysisAnnotations.None; 3051annotations = FlowAnalysisAnnotations.None; 3065annotations = FlowAnalysisAnnotations.None; 3070annotations = FlowAnalysisAnnotations.None; 3861var annotations = createMethod.GetFlowAnalysisAnnotations(); 5175var parameterAnnotations = GetParameterAnnotations(parameter); 6283var annotations = GetCorrespondingParameter(0, node.Method.Parameters, node.ArgsToParamsOpt, node.Expanded, ref paramsIterationType).Annotations; 6636private FlowAnalysisAnnotations GetRValueAnnotations(Symbol? symbol) 6642return FlowAnalysisAnnotations.None; 6645var annotations = symbol.GetFlowAnalysisAnnotations(); 6646return annotations & (FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull); 6649private FlowAnalysisAnnotations GetParameterAnnotations(ParameterSymbol parameter) 6654return FlowAnalysisAnnotations.None; 6656var annotations = parameter.FlowAnalysisAnnotations; 6662bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenTrue; 6663bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenFalse; 6666annotations &= ~FlowAnalysisAnnotations.NotNull; 6670bool hasMaybeNullWhenTrue = (annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNullWhenTrue; 6671bool hasMaybeNullWhenFalse = (annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNullWhenFalse; 6674annotations &= ~FlowAnalysisAnnotations.MaybeNull; 6686private static TypeWithAnnotations ApplyLValueAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations flowAnalysisAnnotations) 6688if ((flowAnalysisAnnotations & FlowAnalysisAnnotations.DisallowNull) == FlowAnalysisAnnotations.DisallowNull) 6692else if ((flowAnalysisAnnotations & FlowAnalysisAnnotations.AllowNull) == FlowAnalysisAnnotations.AllowNull) 6703private static TypeWithState ApplyUnconditionalAnnotations(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 6705if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 6710if ((annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNull) 6718private static TypeWithAnnotations ApplyUnconditionalAnnotations(TypeWithAnnotations declaredType, FlowAnalysisAnnotations annotations) 6720if ((annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNull) 6725if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 6921(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, bool isExpandedParamsArgument) = 6993(ParameterSymbol? parameter, TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations, _) = 7024if (!IsAnalyzingAttribute && method is object && (method.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) == FlowAnalysisAnnotations.DoesNotReturn) 7280ImmutableArray<FlowAnalysisAnnotations> parameterAnnotationsOpt, 7312private ImmutableArray<FlowAnalysisAnnotations> GetParametersAnnotations(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parametersOpt, ImmutableArray<int> argsToParamsOpt, bool expanded) 7314ImmutableArray<FlowAnalysisAnnotations> parameterAnnotationsOpt = default; 7340private VisitResult VisitArgumentEvaluate(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations) 7352private VisitResult VisitArgumentEvaluateEpilogue(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations) 7363switch (annotations & (FlowAnalysisAnnotations.DoesNotReturnIfTrue | FlowAnalysisAnnotations.DoesNotReturnIfFalse)) 7365case FlowAnalysisAnnotations.DoesNotReturnIfTrue: 7372case FlowAnalysisAnnotations.DoesNotReturnIfFalse: 7410FlowAnalysisAnnotations parameterAnnotations, 7492private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7510private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7512return ((targetAnnotations & FlowAnalysisAnnotations.DisallowNull) != 0) && 7547FlowAnalysisAnnotations parameterAnnotations, 7582var leftAnnotations = GetLValueAnnotations(argument); 7601var leftAnnotations = GetLValueAnnotations(argument); 7640FlowAnalysisAnnotations notNullBasedOnParameters(FlowAnalysisAnnotations parameterAnnotations, ArrayBuilder<ParameterSymbol>? notNullParametersOpt, ParameterSymbol parameter) 7651return FlowAnalysisAnnotations.NotNull; 7659void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7684static bool hasConditionalPostCondition(FlowAnalysisAnnotations annotations) 7686return (((annotations & FlowAnalysisAnnotations.MaybeNullWhenTrue) != 0) ^ ((annotations & FlowAnalysisAnnotations.MaybeNullWhenFalse) != 0)) || 7687(((annotations & FlowAnalysisAnnotations.NotNullWhenTrue) != 0) ^ ((annotations & FlowAnalysisAnnotations.NotNullWhenFalse) != 0)); 7690static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7692if ((annotations & FlowAnalysisAnnotations.MaybeNull) != 0) 7698if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 7707static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7709bool notNullWhenTrue = (annotations & FlowAnalysisAnnotations.NotNullWhenTrue) != 0; 7710bool maybeNullWhenTrue = (annotations & FlowAnalysisAnnotations.MaybeNullWhenTrue) != 0; 7711bool maybeNullWhenFalse = (annotations & FlowAnalysisAnnotations.MaybeNullWhenFalse) != 0; 7726static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7728bool notNullWhenFalse = (annotations & FlowAnalysisAnnotations.NotNullWhenFalse) != 0; 7729bool maybeNullWhenTrue = (annotations & FlowAnalysisAnnotations.MaybeNullWhenTrue) != 0; 7730bool maybeNullWhenFalse = (annotations & FlowAnalysisAnnotations.MaybeNullWhenFalse) != 0; 7749private void LearnFromPostConditions(BoundExpression argument, FlowAnalysisAnnotations parameterAnnotations) 7752bool notNullWhenTrue = (parameterAnnotations & FlowAnalysisAnnotations.NotNullWhenTrue) != 0; 7753bool notNullWhenFalse = (parameterAnnotations & FlowAnalysisAnnotations.NotNullWhenFalse) != 0; 7756bool maybeNullWhenTrue = (parameterAnnotations & FlowAnalysisAnnotations.MaybeNullWhenTrue) != 0; 7757bool maybeNullWhenFalse = (parameterAnnotations & FlowAnalysisAnnotations.MaybeNullWhenFalse) != 0; 7842private (ParameterSymbol? Parameter, TypeWithAnnotations Type, FlowAnalysisAnnotations Annotations, bool isExpandedParamsArgument) GetCorrespondingParameter( 7870return (parameter, paramsIterationType, FlowAnalysisAnnotations.None, isExpandedParamsArgument: true); 9442var parameterAnnotations = GetParameterAnnotations(parameter); 10002FlowAnalysisAnnotations leftAnnotations = GetLValueAnnotations(left); 10052var annotations = IsAnalyzingAttribute ? FlowAnalysisAnnotations.None : property.GetFlowAnalysisAnnotations(); 10083private FlowAnalysisAnnotations GetLValueAnnotations(BoundExpression expr) 10091return FlowAnalysisAnnotations.None; 10094var annotations = expr switch 10100=> ToInwardAnnotations(GetParameterAnnotations(parameter) & ~FlowAnalysisAnnotations.NotNull), // NotNull is enforced upon method exit 10101_ => FlowAnalysisAnnotations.None 10104return annotations & (FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull); 10107private static FlowAnalysisAnnotations GetFieldAnnotations(FieldSymbol field) 10114private FlowAnalysisAnnotations GetObjectInitializerMemberLValueAnnotations(Symbol memberSymbol) 10120return FlowAnalysisAnnotations.None; 10123var annotations = memberSymbol switch { PropertySymbol prop => prop.GetFlowAnalysisAnnotations(), FieldSymbol field => GetFieldAnnotations(field), _ => FlowAnalysisAnnotations.None }; 10125return annotations & (FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull); 10128private static FlowAnalysisAnnotations ToInwardAnnotations(FlowAnalysisAnnotations outwardAnnotations) 10130var annotations = FlowAnalysisAnnotations.None; 10131if ((outwardAnnotations & FlowAnalysisAnnotations.MaybeNull) != 0) 10134annotations |= FlowAnalysisAnnotations.AllowNull; 10136if ((outwardAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 10139annotations |= FlowAnalysisAnnotations.DisallowNull; 10324var leftAnnotations = GetLValueAnnotations(variable.Expression); 10607var leftArgumentAnnotations = GetLValueAnnotations(node.Left); 10834var memberAnnotations = GetRValueAnnotations(member);
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
150public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Lowering\SynthesizedMethodBaseSymbol.cs (3)
208public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => BaseMethod.ReturnTypeFlowAnalysisAnnotations; 212public sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
44public override FlowAnalysisAnnotations FlowAnalysisAnnotations 45=> FlowAnalysisAnnotations.None;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
104public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\ErrorMethodSymbol.cs (4)
173public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 177public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\FieldSymbol.cs (1)
70public abstract FlowAnalysisAnnotations FlowAnalysisAnnotations { get; }
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (4)
845public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 847public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
87internal override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Metadata\PE\PEFieldSymbol.cs (24)
53public bool SetFlowAnalysisAnnotations(FlowAnalysisAnnotations value) 55Debug.Assert((value & ~(FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull | FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull)) == 0); 58if ((value & FlowAnalysisAnnotations.DisallowNull) != 0) bitsToSet |= PackedFlags.HasDisallowNullAttribute; 59if ((value & FlowAnalysisAnnotations.AllowNull) != 0) bitsToSet |= PackedFlags.HasAllowNullAttribute; 60if ((value & FlowAnalysisAnnotations.MaybeNull) != 0) bitsToSet |= PackedFlags.HasMaybeNullAttribute; 61if ((value & FlowAnalysisAnnotations.NotNull) != 0) bitsToSet |= PackedFlags.HasNotNullAttribute; 66public bool TryGetFlowAnalysisAnnotations(out FlowAnalysisAnnotations value) 69value = FlowAnalysisAnnotations.None; 70if ((theBits & PackedFlags.HasDisallowNullAttribute) != 0) value |= FlowAnalysisAnnotations.DisallowNull; 71if ((theBits & PackedFlags.HasAllowNullAttribute) != 0) value |= FlowAnalysisAnnotations.AllowNull; 72if ((theBits & PackedFlags.HasMaybeNullAttribute) != 0) value |= FlowAnalysisAnnotations.MaybeNull; 73if ((theBits & PackedFlags.HasNotNullAttribute) != 0) value |= FlowAnalysisAnnotations.NotNull; 401public override FlowAnalysisAnnotations FlowAnalysisAnnotations 405FlowAnalysisAnnotations value; 415private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(PEModule module, FieldDefinitionHandle handle) 417FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None; 418if (module.HasAttribute(handle, AttributeDescription.AllowNullAttribute)) annotations |= FlowAnalysisAnnotations.AllowNull; 419if (module.HasAttribute(handle, AttributeDescription.DisallowNullAttribute)) annotations |= FlowAnalysisAnnotations.DisallowNull; 420if (module.HasAttribute(handle, AttributeDescription.MaybeNullAttribute)) annotations |= FlowAnalysisAnnotations.MaybeNull; 421if (module.HasAttribute(handle, AttributeDescription.NotNullAttribute)) annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Metadata\PE\PEMethodSymbol.cs (4)
666public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => Signature.ReturnParam.FlowAnalysisAnnotations; 670public override FlowAnalysisAnnotations FlowAnalysisAnnotations 681return _packedFlags.DoesNotReturn ? FlowAnalysisAnnotations.DoesNotReturn : FlowAnalysisAnnotations.None;
Symbols\Metadata\PE\PEParameterSymbol.cs (19)
99Debug.Assert(EnumUtilities.ContainsAllValues<FlowAnalysisAnnotations>(FlowAnalysisAnnotationsMask)); 136public bool SetFlowAnalysisAnnotations(FlowAnalysisAnnotations value) 142public bool TryGetFlowAnalysisAnnotations(out FlowAnalysisAnnotations value) 145value = (FlowAnalysisAnnotations)((theBits >> FlowAnalysisAnnotationsOffset) & FlowAnalysisAnnotationsMask); 778internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 782FlowAnalysisAnnotations value; 792private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(PEModule module, ParameterHandle handle) 794FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None; 795if (module.HasAttribute(handle, AttributeDescription.AllowNullAttribute)) annotations |= FlowAnalysisAnnotations.AllowNull; 796if (module.HasAttribute(handle, AttributeDescription.DisallowNullAttribute)) annotations |= FlowAnalysisAnnotations.DisallowNull; 800annotations |= FlowAnalysisAnnotations.MaybeNull; 804annotations |= (when ? FlowAnalysisAnnotations.MaybeNullWhenTrue : FlowAnalysisAnnotations.MaybeNullWhenFalse); 809annotations |= FlowAnalysisAnnotations.NotNull; 813annotations |= (when ? FlowAnalysisAnnotations.NotNullWhenTrue : FlowAnalysisAnnotations.NotNullWhenFalse); 818annotations |= (condition ? FlowAnalysisAnnotations.DoesNotReturnIfTrue : FlowAnalysisAnnotations.DoesNotReturnIfFalse);
Symbols\MethodSymbol.cs (2)
249public abstract FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations { get; } 256public abstract FlowAnalysisAnnotations FlowAnalysisAnnotations { get; }
Symbols\ParameterSymbol.cs (1)
402internal abstract FlowAnalysisAnnotations FlowAnalysisAnnotations { get; }
Symbols\ReducedExtensionMethodSymbol.cs (2)
497public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => _reducedFrom.ReturnTypeFlowAnalysisAnnotations; 501public override FlowAnalysisAnnotations FlowAnalysisAnnotations => _reducedFrom.FlowAnalysisAnnotations;
Symbols\SignatureOnlyMethodSymbol.cs (4)
79public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 83public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\SignatureOnlyParameterSymbol.cs (1)
89internal override FlowAnalysisAnnotations FlowAnalysisAnnotations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (8)
243public override FlowAnalysisAnnotations FlowAnalysisAnnotations 246private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(FieldWellKnownAttributeData attributeData) 248var annotations = FlowAnalysisAnnotations.None; 251if (attributeData.HasAllowNullAttribute) annotations |= FlowAnalysisAnnotations.AllowNull; 252if (attributeData.HasDisallowNullAttribute) annotations |= FlowAnalysisAnnotations.DisallowNull; 253if (attributeData.HasMaybeNullAttribute) annotations |= FlowAnalysisAnnotations.MaybeNull; 254if (attributeData.HasNotNullAttribute) annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\SourceClonedParameterSymbol.cs (2)
143internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 145get { return FlowAnalysisAnnotations.None; }
Symbols\Source\SourceComplexParameterSymbol.cs (15)
143internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 151private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(ParameterWellKnownAttributeData attributeData) 155return FlowAnalysisAnnotations.None; 157FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None; 158if (attributeData.HasAllowNullAttribute) annotations |= FlowAnalysisAnnotations.AllowNull; 159if (attributeData.HasDisallowNullAttribute) annotations |= FlowAnalysisAnnotations.DisallowNull; 163annotations |= FlowAnalysisAnnotations.MaybeNull; 169annotations |= (when ? FlowAnalysisAnnotations.MaybeNullWhenTrue : FlowAnalysisAnnotations.MaybeNullWhenFalse); 175annotations |= FlowAnalysisAnnotations.NotNull; 181annotations |= (when ? FlowAnalysisAnnotations.NotNullWhenTrue : FlowAnalysisAnnotations.NotNullWhenFalse); 187annotations |= (condition ? FlowAnalysisAnnotations.DoesNotReturnIfTrue : FlowAnalysisAnnotations.DoesNotReturnIfFalse);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (4)
1250if ((baseMethod.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) == FlowAnalysisAnnotations.DoesNotReturn && 1251(overrideMethod.FlowAnalysisAnnotations & FlowAnalysisAnnotations.DoesNotReturn) != FlowAnalysisAnnotations.DoesNotReturn)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (10)
109public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => 673public override FlowAnalysisAnnotations FlowAnalysisAnnotations 681private static FlowAnalysisAnnotations DecodeFlowAnalysisAttributes(MethodWellKnownAttributeData attributeData) 682=> attributeData?.HasDoesNotReturnAttribute == true ? FlowAnalysisAnnotations.DoesNotReturn : FlowAnalysisAnnotations.None; 1618private static FlowAnalysisAnnotations DecodeReturnTypeAnnotationAttributes(ReturnTypeWellKnownAttributeData attributeData) 1620FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None; 1625annotations |= FlowAnalysisAnnotations.MaybeNull; 1629annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\SourcePropertyAccessorSymbol.cs (9)
354public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations 360return FlowAnalysisAnnotations.None; 363var result = FlowAnalysisAnnotations.None; 366result |= FlowAnalysisAnnotations.MaybeNull; 370result |= FlowAnalysisAnnotations.NotNull; 793var annotations = ReturnTypeFlowAnalysisAnnotations; 794if ((annotations & FlowAnalysisAnnotations.MaybeNull) != 0) 798if ((annotations & FlowAnalysisAnnotations.NotNull) != 0)
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
127internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 129get { return FlowAnalysisAnnotations.None; }
Symbols\Source\ThisParameterSymbol.cs (2)
73internal sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations 75get { return FlowAnalysisAnnotations.None; }
Symbols\SymbolExtensions.cs (7)
450internal static FlowAnalysisAnnotations GetFlowAnalysisAnnotations(this PropertySymbol property) 452var annotations = property.GetOwnOrInheritedGetMethod()?.ReturnTypeFlowAnalysisAnnotations ?? FlowAnalysisAnnotations.None; 464annotations |= FlowAnalysisAnnotations.AllowNull; 468annotations |= FlowAnalysisAnnotations.DisallowNull; 475internal static FlowAnalysisAnnotations GetFlowAnalysisAnnotations(this Symbol? symbol) 483_ => FlowAnalysisAnnotations.None
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (8)
33internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 37var result = FlowAnalysisAnnotations.None; 42result |= FlowAnalysisAnnotations.DisallowNull; 46result |= FlowAnalysisAnnotations.AllowNull; 86var annotations = FlowAnalysisAnnotations; 87if ((annotations & FlowAnalysisAnnotations.DisallowNull) != 0) 91if ((annotations & FlowAnalysisAnnotations.AllowNull) != 0)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
167public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (4)
145public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 149public sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
89public override FlowAnalysisAnnotations FlowAnalysisAnnotations 90=> FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (4)
120public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 214public sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations 216get { return FlowAnalysisAnnotations.None; }
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
106public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
159public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (2)
78public sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
149public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (4)
232public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 236public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedParameterSymbol.cs (3)
120internal override FlowAnalysisAnnotations FlowAnalysisAnnotations 122get { return FlowAnalysisAnnotations.None; } 414internal override FlowAnalysisAnnotations FlowAnalysisAnnotations
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
197public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (4)
163public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 167public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (4)
143public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None; 147public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
Symbols\TypeWithState.cs (6)
40public static TypeWithState Create(TypeWithAnnotations typeWithAnnotations, FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None) 48if ((annotations & FlowAnalysisAnnotations.MaybeNull) == FlowAnalysisAnnotations.MaybeNull) 52else if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull)
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
47public override FlowAnalysisAnnotations FlowAnalysisAnnotations
Symbols\Wrapped\WrappedMethodSymbol.cs (2)
322public sealed override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => UnderlyingMethod.ReturnTypeFlowAnalysisAnnotations; 326public sealed override FlowAnalysisAnnotations FlowAnalysisAnnotations => UnderlyingMethod.FlowAnalysisAnnotations;
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
144internal override FlowAnalysisAnnotations FlowAnalysisAnnotations