1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
213this.compilation = compilation;
70 references to compilation
Microsoft.CodeAnalysis.CSharp (70)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (7)
487if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 512if (!compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1285if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1337else if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1588Binder.InferConstantIndexFromSystemIndex(compilation, elementAccess.Argument, length, out _) is 0)) 2595if (!type.IsFromCompilation(this.compilation)) 2775node.Type.OriginalDefinition.Equals(compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (59)
298SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 303SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 311VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(compilation)); 333private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 501compilation.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } && 999|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1793if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 1994var conversionsWithoutNullability = this.compilation.Conversions; 2304if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 2886_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 2964if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3320var resultType = ResultType.ToTypeWithAnnotations(compilation); 3442type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 3722var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4300var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4378arg.ToTypeWithAnnotations(compilation)); 4492placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 4521inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4683TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 4952SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5846BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 5847BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 6206var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 6207|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 6209isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 6217.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 6220isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 6361return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 6362|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 6440else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 7390var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 7396SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 7827var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 7861new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8266ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 8288tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 8484compilation, 8540compilation, 8555compilation, 9327var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 9378return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 9654arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 9818var lvalueType = rightState.ToTypeWithAnnotations(compilation); 10027placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 10121_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 10243expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 10326var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 10644if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 10648if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 10662var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 10738targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 10748else if (ForEachLoopBinder.IsIEnumerableT(node.Expression.Type.OriginalDefinition, isAsync, compilation)) 10753targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 10785SetAnalyzedNullability(node.Expression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 10817NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 10885TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 10930destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 11660new VisitResult(result, result.ToTypeWithAnnotations(compilation)), 11811TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (3)
349var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 646var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 904placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));