1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212
this.
compilation
= compilation;
79 references to compilation
Microsoft.CodeAnalysis.CSharp (79)
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)
2631
if (!type.IsFromCompilation(this.
compilation
))
2801
node.Type.OriginalDefinition.Equals(
compilation
.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker_Patterns.cs (5)
165
pattern = UnionMatchingRewriter.Rewrite(
compilation
, pattern);
391
var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(
compilation
);
528
TrackNullableStateForAssignment(valueOpt: null, inputTypeWithState.ToTypeWithAnnotations(
compilation
), outputSlot, inputTypeWithState, inputSlot);
635
var inferredType = value.ToTypeWithAnnotations(
compilation
, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType);
1136
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(
compilation
)));
FlowAnalysis\NullableWalker.cs (65)
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);
553
compilation
.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } &&
964
||
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)))
1984
if (
compilation
.TestOnlyCompilationData is NullableAnalysisData { Data: { } state })
2544
if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(
compilation
))
3193
_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(
compilation
)));
3272
if (method.IsAsyncEffectivelyReturningGenericTask(
compilation
))
3290
if (node.Type == (object)this.
compilation
.ImplicitlyTypedVariableUsedInForbiddenZoneType)
3661
var resultType = ResultType.ToTypeWithAnnotations(
compilation
);
3808
type = valueType.ToAnnotatedTypeWithAnnotations(
compilation
);
4288
var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.
compilation
, collectionType, out var targetElementType);
5000
var lvalueType = resultType.ToTypeWithAnnotations(
compilation
);
5078
arg.ToTypeWithAnnotations(
compilation
));
5192
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(
compilation
)));
5221
inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(
compilation
);
5384
Binder.IsWellKnownSystemRange(node.Indices[0].Type,
compilation
))
5669
SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(
compilation
));
5787
[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, leftUnderlyingType.Type),
5788
new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, rightUnderlyingType.Type)],
6623
BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(
compilation
));
6624
BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(
compilation
));
7192
var isStaticEqualsMethod = method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
7193
|| method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
7195
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals))
7203
.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__Equals));
7206
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals)))
7347
return method.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind)
7348
|| method.OriginalDefinition.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind);
7431
else if (method.OriginalDefinition ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
8479
var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(
compilation
);
8485
SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(
compilation
)), isLvalue: true);
8997
var argumentType = visitResult.RValueType.ToTypeWithAnnotations(
compilation
);
9032
new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
9061
var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded);
9472
ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(
compilation
));
9494
tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null),
9748
compilation
,
9804
compilation
,
9819
compilation
,
10762
SetAnalyzedNullability(sourceToParameterConversion, new VisitResult(operandType, operandType.ToTypeWithAnnotations(
compilation
)));
10782
SetAnalyzedNullability(unionConstructionConversion, new VisitResult(unionTypeWithState, unionTypeWithState.ToTypeWithAnnotations(
compilation
)));
10840
var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(
compilation
));
10896
return
compilation
.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying));
11175
arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(
compilation
)));
11350
var lvalueType = rightState.ToTypeWithAnnotations(
compilation
);
11561
placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(
compilation
)));
11661
_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(
compilation
));
11783
expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(
compilation
));
11959
var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(
compilation
);
12455
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
12459
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue))
12473
var getValue = (MethodSymbol?)
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value);
12576
targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(
compilation
);
12586
else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync,
compilation
))
12591
targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync,
compilation
, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _));
12626
SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(
compilation
)));
12658
NamedTypeSymbol spanType =
compilation
.GetWellKnownType(wellKnownSpan);
12716
TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(
compilation
);
12761
destinationType = sourceState.ToAnnotatedTypeWithAnnotations(
compilation
);
12970
[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, operandType.Type)],
13601
new VisitResult(result, result.ToTypeWithAnnotations(
compilation
)),
13752
TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(
compilation
, RefKind.None,