1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212this.compilation = compilation;
77 references to compilation
Microsoft.CodeAnalysis.CSharp (77)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (8)
447if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 472if (!compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1245if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1297else if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1548Binder.InferConstantIndexFromSystemIndex(compilation, elementAccess.Argument, length, out _) is 0)) 2310if (node.Type == (object)this.compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType) 2598if (!type.IsFromCompilation(this.compilation)) 2768node.Type.OriginalDefinition.Equals(compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (64)
323SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 328SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 336VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(compilation)); 358private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 535compilation.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } && 934|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1929if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 2130var conversionsWithoutNullability = this.compilation.Conversions; 2464if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 3105_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3184if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3202if (node.Type == (object)this.compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType) 3573var resultType = ResultType.ToTypeWithAnnotations(compilation); 3693type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 4171var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4848var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4926arg.ToTypeWithAnnotations(compilation)); 5040placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 5069inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 5232TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 5501SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5619[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, leftUnderlyingType.Type), 5620new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, rightUnderlyingType.Type)], 6453BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 6454BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 7001var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 7002|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 7004isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 7012.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 7015isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 7156return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 7157|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 7240else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 8252var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 8258SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 8751var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8786new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8815var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded); 9226ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 9248tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 9444compilation, 9500compilation, 9515compilation, 10305var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 10356return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 10635arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 10810var lvalueType = rightState.ToTypeWithAnnotations(compilation); 11016placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 11114_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 11236expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 11400var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 11837if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 11841if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 11855var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 11949targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 11959else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync, compilation)) 11964targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 11999SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 12031NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 12099TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 12144destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 12353[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(compilation).NullableAnnotation, operandType.Type)], 12986new VisitResult(result, result.ToTypeWithAnnotations(compilation)), 13137TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (4)
387var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 524TrackNullableStateForAssignment(valueOpt: null, inputTypeWithState.ToTypeWithAnnotations(compilation), outputSlot, inputTypeWithState, inputSlot); 631var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 1042placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));