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)) 2645if (!type.IsFromCompilation(this.compilation)) 2813node.Type.OriginalDefinition.Equals(compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions))
FlowAnalysis\NullableWalker.cs (63)
304SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 309SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 317VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(compilation)); 339private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 516compilation.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } && 916|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1910if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 2111var conversionsWithoutNullability = this.compilation.Conversions; 2445if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 3086_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3165if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3555var resultType = ResultType.ToTypeWithAnnotations(compilation); 3677type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 4023var collectionKind = ConversionsBase.GetCollectionExpressionTypeKind(this.compilation, collectionType, out var targetElementType); 4639var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4717arg.ToTypeWithAnnotations(compilation)); 4831placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 4860inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 5023TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 5292SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5410[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, leftUnderlyingType.Type), 5411new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, rightUnderlyingType.Type)], 6244BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 6245BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 6745var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 6746|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 6748isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 6756.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 6759isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 6900return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 6901|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 6984else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 8003var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 8009SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 8445var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 8480new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8509var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded); 8920ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 8942tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 9138compilation, 9194compilation, 9209compilation, 10000var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 10051return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 10330arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 10505var lvalueType = rightState.ToTypeWithAnnotations(compilation); 10713placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 10811_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 10933expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 11094var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 11520if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 11524if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 11538var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 11634targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 11644else if (ForEachLoopBinder.IsIEnumerableT(collectionExpression.Type.OriginalDefinition, isAsync, compilation)) 11649targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple, needSupportForRefStructInterfaces: out _)); 11684SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 11716NamedTypeSymbol spanType = compilation.GetWellKnownType(wellKnownSpan); 11784TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 11829destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 12031[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(compilation).NullableAnnotation, operandType.Type)], 12664new VisitResult(result, result.ToTypeWithAnnotations(compilation)), 12815TypeWithAnnotations 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)));