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)
496
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
521
if (!
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1294
if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1346
else if (
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))
1597
Binder.InferConstantIndexFromSystemIndex(
compilation
, elementAccess.Argument, length, out _) is 0))
2653
if (!type.IsFromCompilation(this.
compilation
))
2821
node.Type.OriginalDefinition.Equals(
compilation
.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (63)
304
SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: updateAnalyzedNullability);
309
SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(
compilation
));
317
VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(
compilation
));
339
private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(
compilation
), updateAnalyzedNullability: false);
510
compilation
.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } &&
910
||
compilation
.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)))
1904
if (
compilation
.TestOnlyCompilationData is NullableAnalysisData { Data: { } state })
2105
var conversionsWithoutNullability = this.
compilation
.Conversions;
2439
if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(
compilation
))
3080
_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(
compilation
)));
3159
if (method.IsAsyncEffectivelyReturningGenericTask(
compilation
))
3549
var resultType = ResultType.ToTypeWithAnnotations(
compilation
);
3671
type = valueType.ToAnnotatedTypeWithAnnotations(
compilation
);
4017
var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.
compilation
, collectionType, out var targetElementType);
4632
var lvalueType = resultType.ToTypeWithAnnotations(
compilation
);
4710
arg.ToTypeWithAnnotations(
compilation
));
4824
placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(
compilation
)));
4853
inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(
compilation
);
5016
TypeSymbol.Equals(node.Indices[0].Type,
compilation
.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2))
5285
SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(
compilation
));
5403
[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, leftUnderlyingType.Type),
5404
new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, rightUnderlyingType.Type)],
6237
BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(
compilation
));
6238
BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(
compilation
));
6737
var isStaticEqualsMethod = method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
6738
|| method.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
6740
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals))
6748
.Equals(
compilation
.GetSpecialTypeMember(SpecialMember.System_Object__Equals));
6751
isWellKnownEqualityMethodOrImplementation(
compilation
, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals)))
6892
return method.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind)
6893
|| method.OriginalDefinition.Equals(
compilation
.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind);
6976
else if (method.OriginalDefinition ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
8000
var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(
compilation
);
8006
SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(
compilation
)), isLvalue: true);
8442
var argumentType = visitResult.RValueType.ToTypeWithAnnotations(
compilation
);
8477
new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
8506
var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded);
8916
ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(
compilation
));
8938
tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(
compilation
, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null),
9134
compilation
,
9190
compilation
,
9205
compilation
,
9988
var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(
compilation
));
10039
return
compilation
.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying));
10318
arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(
compilation
)));
10493
var lvalueType = rightState.ToTypeWithAnnotations(
compilation
);
10701
placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(
compilation
)));
10799
_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(
compilation
));
10921
expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(
compilation
));
11082
var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(
compilation
);
11502
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value))
11506
if (getMethod ==
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue))
11520
var getValue = (MethodSymbol)
compilation
.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value);
11613
targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(
compilation
);
11623
else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync,
compilation
))
11628
targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync,
compilation
, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _));
11660
SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(
compilation
)));
11692
NamedTypeSymbol spanType =
compilation
.GetWellKnownType(wellKnownSpan);
11760
TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(
compilation
);
11805
destinationType = sourceState.ToAnnotatedTypeWithAnnotations(
compilation
);
12007
[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(
compilation
).NullableAnnotation, operandType.Type)],
12640
new VisitResult(result, result.ToTypeWithAnnotations(
compilation
)),
12791
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
)));