1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
212this.compilation = compilation;
74 references to compilation
Microsoft.CodeAnalysis.CSharp (74)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (7)
496if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 521if (!compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1294if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1346else if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1597Binder.InferConstantIndexFromSystemIndex(compilation, elementAccess.Argument, length, out _) is 0)) 2647if (!type.IsFromCompilation(this.compilation)) 2815node.Type.OriginalDefinition.Equals(compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (63)
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 } && 935|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1930if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 2131var conversionsWithoutNullability = this.compilation.Conversions; 2465if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 3106_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3185if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3575var resultType = ResultType.ToTypeWithAnnotations(compilation); 3695type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 4041var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4694var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4772arg.ToTypeWithAnnotations(compilation)); 4886placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 4915inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 5078TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 5347SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5465[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, leftUnderlyingType.Type), 5466new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, rightUnderlyingType.Type)], 6299BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 6300BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 6800var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 6801|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 6803isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 6811.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 6814isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 6955return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 6956|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 7039else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 8058var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 8064SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 8546var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8581new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8610var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded); 9021ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 9043tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 9239compilation, 9295compilation, 9310compilation, 10101var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 10152return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 10431arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 10606var lvalueType = rightState.ToTypeWithAnnotations(compilation); 10814placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 10912_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 11034expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 11195var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 11621if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 11625if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 11639var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 11735targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 11745else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync, compilation)) 11750targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 11785SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 11817NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 11885TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 11930destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 12132[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(compilation).NullableAnnotation, operandType.Type)], 12765new VisitResult(result, result.ToTypeWithAnnotations(compilation)), 12916TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (3)
387var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 686var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 944placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));