1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212
this.
compilation
= compilation;
80 references to compilation
Microsoft.CodeAnalysis.CSharp (80)
FlowAnalysis\AbstractFlowPass.cs (1)
945
UnionMatchingRewriter.Rewrite(
compilation
, pattern) is BoundRecursivePattern
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96
if (
compilation
.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (8)
447
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
472
if (!
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1246
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1298
else if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1549
Binder.InferConstantIndexFromSystemIndex(
compilation
, elementAccess.Argument, length, out _) is 0))
2311
if (node.Type == (object)this.
compilation
.ImplicitlyTypedVariableUsedInForbiddenZoneType)
2599
if (!type.IsFromCompilation(this.
compilation
))
2769
node.Type.OriginalDefinition.Equals(
compilation
.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (66)
323
SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: updateAnalyzedNullability);
328
SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
));
336
VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(
compilation
));
358
private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: false);
536
compilation
.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } &&
935
||
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)))
1930
if (
compilation
.TestOnlyCompilationData is NullableAnalysisData { Data: { } state })
2130
var conversionsWithoutNullability = this.
compilation
.Conversions;
2464
if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(
compilation
))
3106
_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(
compilation
)));
3185
if (method.IsAsyncEffectivelyReturningGenericTask(
compilation
))
3203
if (node.Type == (object)this.
compilation
.ImplicitlyTypedVariableUsedInForbiddenZoneType)
3574
var resultType = ResultType.ToTypeWithAnnotations(
compilation
);
3721
type = valueType.ToAnnotatedTypeWithAnnotations(
compilation
);
4199
var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.
compilation
, collectionType, out var targetElementType);
4920
var lvalueType = resultType.ToTypeWithAnnotations(
compilation
);
4998
arg.ToTypeWithAnnotations(
compilation
));
5112
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(
compilation
)));
5141
inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(
compilation
);
5304
TypeSymbol.Equals(node.Indices[0].Type,
compilation
.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2))
5573
SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(
compilation
));
5691
[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, leftUnderlyingType.Type),
5692
new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, rightUnderlyingType.Type)],
6527
BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(
compilation
));
6528
BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(
compilation
));
7075
var isStaticEqualsMethod = method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
7076
|| method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
7078
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals))
7086
.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__Equals));
7089
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals)))
7230
return method.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind)
7231
|| method.OriginalDefinition.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind);
7314
else if (method.OriginalDefinition ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
8351
var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(
compilation
);
8357
SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(
compilation
)), isLvalue: true);
8875
var argumentType = visitResult.RValueType.ToTypeWithAnnotations(
compilation
);
8910
new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
8939
var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded);
9350
ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(
compilation
));
9372
tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null),
9627
compilation
,
9683
compilation
,
9698
compilation
,
10632
SetAnalyzedNullability(sourceToParameterConversion, new VisitResult(operandType, operandType.ToTypeWithAnnotations(
compilation
)));
10641
SetAnalyzedNullability(unionConstructionConversion, new VisitResult(unionTypeWithState, unionTypeWithState.ToTypeWithAnnotations(
compilation
)));
10699
var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(
compilation
));
10755
return
compilation
.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying));
11034
arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(
compilation
)));
11209
var lvalueType = rightState.ToTypeWithAnnotations(
compilation
);
11415
placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(
compilation
)));
11513
_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(
compilation
));
11635
expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(
compilation
));
11807
var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(
compilation
);
12263
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
12267
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue))
12281
var getValue = (MethodSymbol)
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value);
12375
targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(
compilation
);
12385
else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync,
compilation
))
12390
targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync,
compilation
, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _));
12425
SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(
compilation
)));
12457
NamedTypeSymbol spanType =
compilation
.GetWellKnownType(wellKnownSpan);
12515
TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(
compilation
);
12560
destinationType = sourceState.ToAnnotatedTypeWithAnnotations(
compilation
);
12769
[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, operandType.Type)],
13407
new VisitResult(result, result.ToTypeWithAnnotations(
compilation
)),
13558
TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(
compilation
, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (4)
387
var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(
compilation
);
524
TrackNullableStateForAssignment(valueOpt: null, inputTypeWithState.ToTypeWithAnnotations(
compilation
), outputSlot, inputTypeWithState, inputSlot);
631
var inferredType = value.ToTypeWithAnnotations(
compilation
, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType);
1042
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(
compilation
)));