1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212
this.
compilation
= compilation;
74 references to compilation
Microsoft.CodeAnalysis.CSharp (74)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96
if (
compilation
.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (7)
447
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
472
if (!
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1245
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1297
else if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1548
Binder.InferConstantIndexFromSystemIndex(
compilation
, elementAccess.Argument, length, out _) is 0))
2598
if (!type.IsFromCompilation(this.
compilation
))
2766
node.Type.OriginalDefinition.Equals(
compilation
.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (63)
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);
535
compilation
.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } &&
933
||
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)))
1928
if (
compilation
.TestOnlyCompilationData is NullableAnalysisData { Data: { } state })
2129
var conversionsWithoutNullability = this.
compilation
.Conversions;
2463
if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(
compilation
))
3104
_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(
compilation
)));
3183
if (method.IsAsyncEffectivelyReturningGenericTask(
compilation
))
3573
var resultType = ResultType.ToTypeWithAnnotations(
compilation
);
3693
type = valueType.ToAnnotatedTypeWithAnnotations(
compilation
);
4039
var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.
compilation
, collectionType, out var targetElementType);
4691
var lvalueType = resultType.ToTypeWithAnnotations(
compilation
);
4769
arg.ToTypeWithAnnotations(
compilation
));
4883
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(
compilation
)));
4912
inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(
compilation
);
5075
TypeSymbol.Equals(node.Indices[0].Type,
compilation
.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2))
5344
SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(
compilation
));
5462
[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, leftUnderlyingType.Type),
5463
new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, rightUnderlyingType.Type)],
6296
BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(
compilation
));
6297
BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(
compilation
));
6838
var isStaticEqualsMethod = method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
6839
|| method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
6841
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals))
6849
.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__Equals));
6852
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals)))
6993
return method.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind)
6994
|| method.OriginalDefinition.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind);
7077
else if (method.OriginalDefinition ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
8096
var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(
compilation
);
8102
SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(
compilation
)), isLvalue: true);
8584
var argumentType = visitResult.RValueType.ToTypeWithAnnotations(
compilation
);
8619
new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
8648
var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded);
9059
ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(
compilation
));
9081
tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null),
9277
compilation
,
9333
compilation
,
9348
compilation
,
10139
var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(
compilation
));
10190
return
compilation
.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying));
10469
arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(
compilation
)));
10644
var lvalueType = rightState.ToTypeWithAnnotations(
compilation
);
10850
placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(
compilation
)));
10948
_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(
compilation
));
11070
expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(
compilation
));
11230
var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(
compilation
);
11655
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
11659
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue))
11673
var getValue = (MethodSymbol)
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value);
11766
targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(
compilation
);
11776
else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync,
compilation
))
11781
targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync,
compilation
, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _));
11816
SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(
compilation
)));
11848
NamedTypeSymbol spanType =
compilation
.GetWellKnownType(wellKnownSpan);
11916
TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(
compilation
);
11961
destinationType = sourceState.ToAnnotatedTypeWithAnnotations(
compilation
);
12170
[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, operandType.Type)],
12803
new VisitResult(result, result.ToTypeWithAnnotations(
compilation
)),
12954
TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(
compilation
, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (3)
387
var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(
compilation
);
686
var inferredType = value.ToTypeWithAnnotations(
compilation
, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType);
944
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(
compilation
)));