1 write to compilation
Microsoft.CodeAnalysis.CSharp (1)
FlowAnalysis\AbstractFlowPass.cs (1)
213this.compilation = compilation;
64 references to compilation
Microsoft.CodeAnalysis.CSharp (64)
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\DefiniteAssignment.cs (4)
486if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1243if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 1284if (compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs)) 2472if (!type.IsFromCompilation(this.compilation))
FlowAnalysis\NullableWalker.cs (56)
275SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 280SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 288SetResult(expression, ResultType, ResultType.ToTypeWithAnnotations(compilation), isLvalue: false); 309private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 468compilation.TestOnlyCompilationData is NullableAnalysisData { MaxRecursionDepth: var depth } && 964|| compilation.IsFeatureEnabled(MessageID.IDS_FeatureAutoDefaultStructs))) 1758if (compilation.TestOnlyCompilationData is NullableAnalysisData { Data: { } state }) 1959var conversionsWithoutNullability = this.compilation.Conversions; 2274if (isMaybeDefaultValue(valueType) && !allowUnconstrainedTypeParameterAnnotations(compilation)) 2845_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 2923if (method.IsAsyncEffectivelyReturningGenericTask(compilation)) 3192var resultType = ResultType.ToTypeWithAnnotations(compilation); 3314type = valueType.ToAnnotatedTypeWithAnnotations(compilation); 4087arg.ToTypeWithAnnotations(compilation)); 4201placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 4231inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4395TypeSymbol.Equals(node.Indices[0].Type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything2)) 4739SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5480BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 5481BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 5732var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject)) 5733|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals)); 5735isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 5743.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__Equals)); 5746isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 5887return method.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange), SymbolEqualityComparer.ConsiderEverything.CompareKind) 5888|| method.OriginalDefinition.Equals(compilation.GetWellKnownTypeMember(WellKnownMember.System_Threading_Interlocked__CompareExchange_T), SymbolEqualityComparer.ConsiderEverything.CompareKind); 5974else if (method.OriginalDefinition == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 6750var varType = worstCaseParameterWithState.ToAnnotatedTypeWithAnnotations(compilation); 6756SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 7138var argumentResult = visitArgumentResult.RValueType.ToTypeWithAnnotations(compilation); 7183new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 7573ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 7592tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 7782compilation, 7833compilation, 7846compilation, 8599var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 8647return compilation.GetSpecialType(SpecialType.System_Nullable_T).Construct(ImmutableArray.Create(underlying)); 8923arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 9090var lvalueType = rightState.ToTypeWithAnnotations(compilation); 9297placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 9391_variables.SetType(local.LocalSymbol, operandType.ToAnnotatedTypeWithAnnotations(compilation)); 9513expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 9596var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 9929if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value)) 9933if (getMethod == compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_HasValue)) 9947var getValue = (MethodSymbol)compilation.GetSpecialTypeMember(SpecialMember.System_Nullable_T_get_Value); 10022targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 10032else if (ForEachLoopBinder.IsIEnumerableT(node.Expression.Type.OriginalDefinition, isAsync, compilation)) 10037targetTypeWithAnnotations = TypeWithAnnotations.Create(ForEachLoopBinder.GetIEnumerableOfT(resultType, isAsync, compilation, ref discardedUseSiteInfo, out bool foundMultiple)); 10069SetAnalyzedNullability(node.Expression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 10152TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 10196destinationType = sourceState.ToAnnotatedTypeWithAnnotations(compilation); 10928new VisitArgumentResult(new VisitResult(result, result.ToTypeWithAnnotations(compilation)), stateForLambda: default), 11079TypeWithAnnotations elementType = InMethodBinder.GetIteratorElementTypeFromReturnType(compilation, RefKind.None,
FlowAnalysis\NullableWalker_Patterns.cs (3)
349var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 644var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 900placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));