1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212this.compilation = compilation;
81 references to compilation
Microsoft.CodeAnalysis.CSharp (81)
FlowAnalysis\AbstractFlowPass.cs (1)
945UnionMatchingRewriter.Rewrite(compilation, pattern) is BoundRecursivePattern
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)) 1246if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1298else if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1549Binder.InferConstantIndexFromSystemIndex(compilation, elementAccess.Argument, length, out _) is 0)) 2311if (node.Type == (object)this.compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType) 2599if (!type.IsFromCompilation(this.compilation)) 2769node.Type.OriginalDefinition.Equals(compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (66)
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); 553compilation.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } && 952|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1947if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 2166var conversionsWithoutNullability = this.compilation.Conversions; 2500if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 3142_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3221if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3239if (node.Type == (object)this.compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType) 3610var resultType = ResultType.ToTypeWithAnnotations(compilation); 3757type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 4237var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4960var lvalueType = resultType.ToTypeWithAnnotations(compilation); 5038arg.ToTypeWithAnnotations(compilation)); 5152placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 5181inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 5344TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 5613SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5731[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, leftUnderlyingType.Type), 5732new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, rightUnderlyingType.Type)], 6567BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 6568BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 7115var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 7116|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 7118isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 7126.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 7129isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 7270return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 7271|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 7354else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 8394var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 8400SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 8912var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8947new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8976var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded); 9387ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 9409tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 9663compilation, 9719compilation, 9734compilation, 10671SetAnalyzedNullability(sourceToParameterConversion, new VisitResult(operandType, operandType.ToTypeWithAnnotations(compilation))); 10691SetAnalyzedNullability(unionConstructionConversion, new VisitResult(unionTypeWithState, unionTypeWithState.ToTypeWithAnnotations(compilation))); 10749var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 10805return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 11084arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 11259var lvalueType = rightState.ToTypeWithAnnotations(compilation); 11465placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 11564_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 11686expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 11862var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 12318if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 12322if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 12336var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 12430targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 12440else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync, compilation)) 12445targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 12480SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 12512NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 12570TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 12615destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 12824[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(compilation).NullableAnnotation, operandType.Type)], 13455new VisitResult(result, result.ToTypeWithAnnotations(compilation)), 13606TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (5)
164pattern = UnionMatchingRewriter.Rewrite(compilation, pattern); 389var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 526TrackNullableStateForAssignment(valueOpt: null, inputTypeWithState.ToTypeWithAnnotations(compilation), outputSlot, inputTypeWithState, inputSlot); 633var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 1044placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));