1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
213
this.
compilation
= compilation;
70 references to compilation
Microsoft.CodeAnalysis.CSharp (70)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96
if (
compilation
.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (7)
487
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
512
if (!
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1293
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1345
else if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1596
Binder.InferConstantIndexFromSystemIndex(
compilation
, elementAccess.Argument, length, out _) is 0))
2640
if (!type.IsFromCompilation(this.
compilation
))
2808
node.Type.OriginalDefinition.Equals(
compilation
.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (59)
298
SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: updateAnalyzedNullability);
303
SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
));
311
VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(
compilation
));
333
private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: false);
502
compilation
.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } &&
897
||
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)))
1867
if (
compilation
.TestOnlyCompilationData is NullableAnalysisData { Data: { } state })
2068
var conversionsWithoutNullability = this.
compilation
.Conversions;
2402
if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(
compilation
))
2984
_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(
compilation
)));
3062
if (method.IsAsyncEffectivelyReturningGenericTask(
compilation
))
3452
var resultType = ResultType.ToTypeWithAnnotations(
compilation
);
3574
type = valueType.ToAnnotatedTypeWithAnnotations(
compilation
);
3871
var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.
compilation
, collectionType, out var targetElementType);
4477
var lvalueType = resultType.ToTypeWithAnnotations(
compilation
);
4555
arg.ToTypeWithAnnotations(
compilation
));
4669
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(
compilation
)));
4698
inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(
compilation
);
4860
TypeSymbol.Equals(node.Indices[0].Type,
compilation
.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2))
5129
SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(
compilation
));
6023
BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(
compilation
));
6024
BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(
compilation
));
6383
var isStaticEqualsMethod = method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
6384
|| method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
6386
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals))
6394
.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__Equals));
6397
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals)))
6538
return method.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind)
6539
|| method.OriginalDefinition.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind);
6617
else if (method.OriginalDefinition ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
7605
var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(
compilation
);
7611
SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(
compilation
)), isLvalue: true);
8042
var argumentType = visitResult.RValueType.ToTypeWithAnnotations(
compilation
);
8076
new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
8482
ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(
compilation
));
8504
tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null),
8700
compilation
,
8756
compilation
,
8771
compilation
,
9554
var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(
compilation
));
9605
return
compilation
.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying));
9881
arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(
compilation
)));
10033
var lvalueType = rightState.ToTypeWithAnnotations(
compilation
);
10242
placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(
compilation
)));
10336
_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(
compilation
));
10458
expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(
compilation
));
10541
var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(
compilation
);
10871
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
10875
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue))
10889
var getValue = (MethodSymbol)
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value);
10982
targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(
compilation
);
10992
else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync,
compilation
))
10997
targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync,
compilation
, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _));
11029
SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(
compilation
)));
11061
NamedTypeSymbol spanType =
compilation
.GetWellKnownType(wellKnownSpan);
11129
TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(
compilation
);
11174
destinationType = sourceState.ToAnnotatedTypeWithAnnotations(
compilation
);
11905
new VisitResult(result, result.ToTypeWithAnnotations(
compilation
)),
12056
TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(
compilation
, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (3)
387
var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(
compilation
);
684
var inferredType = value.ToTypeWithAnnotations(
compilation
, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType);
942
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(
compilation
)));