3 writes to Compilation
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder.cs (3)
35this.Compilation = compilation; 43this.Compilation = next.Compilation; 56this.Compilation = next.Compilation;
393 references to Compilation
Microsoft.CodeAnalysis.CSharp (393)
Binder\Binder.cs (8)
43this.Compilation = next.Compilation; 56this.Compilation = next.Compilation; 138return result == OverflowChecks.Enabled || result == OverflowChecks.Implicit && Compilation.Options.CheckOverflow; 160internal bool UseUpdatedEscapeRules => Compilation.SourceModule.UseUpdatedEscapeRules; 265!csTree.IsGeneratedCode(this.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None), 284switch (Compilation.Options.NullableContextOptions) 295throw ExceptionUtilities.UnexpectedValue(Compilation.Options.NullableContextOptions); 856return new CompoundUseSiteInfo<AssemblySymbol>(futureDestination, Compilation.Assembly);
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
183enclosingBinder.Compilation,
Binder\Binder.ValueChecks.cs (5)
1154var getItemOrSliceHelper = (MethodSymbol)Compilation.GetWellKnownTypeMember(elementAccess.GetItemOrSliceHelper); 1234Compilation.GetWellKnownType(WellKnownType.System_Range), 1308else if (this.IsDirectlyInIterator && Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefUnsafeInIteratorAsync)) 1723(Compilation.FeatureStrictEnabled 2050if (setMethod.DeclaringCompilation != this.Compilation)
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
90new ExtendedErrorTypeSymbol(this.Compilation, "", 0, info));
Binder\Binder_AnonymousTypes.cs (1)
105AnonymousTypeManager manager = this.Compilation.AnonymousTypeManager;
Binder\Binder_Attributes.cs (9)
298return new SourceAttributeData(Compilation, (AttributeSyntax)boundAttribute.Syntax, attributeType, attributeConstructor, hasErrors); 336Compilation, 405if (!paramType.Type.IsValidAttributeParameterType(Compilation)) 541if (setMethod.IsInitOnly && setMethod.DeclaringCompilation != this.Compilation) 671if (!namedArgumentType.IsValidAttributeParameterType(Compilation)) 842var typedConstantKind = node.Type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 879var typedConstantKind = type.GetAttributeParameterTypedConstantKind(_binder.Compilation); 929var typedConstantKind = operandType.GetAttributeParameterTypedConstantKind(_binder.Compilation); 984var typedConstantKind = type.GetAttributeParameterTypedConstantKind(_binder.Compilation);
Binder\Binder_Await.cs (7)
41TypeSymbol awaitExpressionType = (info.GetResult ?? info.RuntimeAsyncAwaitCall?.Method)?.ReturnType ?? (hasErrors ? CreateErrorType() : Compilation.DynamicType); 192else if (method.IsIterator && InMethodBinder.IsAsyncStreamInterface(Compilation, method.RefKind, method.ReturnType)) 303var isRuntimeAsyncEnabled = Compilation.IsRuntimeAsyncEnabledIn(this.ContainingMemberOrLambda); 451new ConstraintsHelper.CheckConstraintsArgs(@this.Compilation, @this.Conversions, includeNullability: false, node.Location, tempDiagnostics))) 492var useUnsafeAwait = Compilation.Conversions.ClassifyImplicitConversionFromType( 494Compilation.GetSpecialType(InternalSpecialType.System_Runtime_CompilerServices_ICriticalNotifyCompletion), 516new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, diagnostics));
Binder\Binder_Constraints.cs (1)
322if (!Compilation.Assembly.RuntimeSupportsByRefLikeGenerics)
Binder\Binder_Conversions.cs (27)
438if (Compilation.SourceModule != method.ContainingModule) 442if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces) 450Compilation.SourceModule != method.ContainingModule) 458if (!Compilation.Assembly.RuntimeSupportsInlineArrayTypes) 472if (destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)) 487Debug.Assert(destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions)); 558.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics)); 566TryFindAsSpanCharMethod(Compilation, destination), 728Debug.Assert(destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) || 729destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_FormattableString), TypeCompareKind.ConsiderEverything)); 918if (LocalRewriter.IsAllocatingRefStructCollectionExpression(_node, collectionTypeKind, elementType, _binder.Compilation)) 971if (_targetType.OriginalDefinition.Equals(_binder.Compilation.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T), TypeCompareKind.ConsiderEverything)) 1232var list_T__ctor = (MethodSymbol?)@this._binder.Compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_List_T__ctor); 1233var list_T__ctorInt32 = (MethodSymbol?)@this._binder.Compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_List_T__ctorInt32); 1467var readOnlySpanType = Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T); 1563Debug.Assert(parameterType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 1568Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics)); 1774var elementPlaceholder = new BoundValuePlaceholder(syntax, Compilation.DynamicType) { WasCompilerGenerated = true }; 2021member, receiverType, addMethodBinder.Compilation, ref useSiteInfo, out wasFullyInferred); 2281var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations); 2341GenerateImplicitConversionError(diagnostics, this.Compilation, spreadElement.Expression.Syntax, elementConversion, enumeratorInfo.ElementType, elementType); 2395if (targetTyped && !destination.IsErrorType() && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureTargetTypedConditional)) 2400Compilation.LanguageVersion.ToDisplayString(), 2645delegateType = Compilation.GetWellKnownType(WellKnownType.System_Linq_Expressions_Expression_T).Construct(delegateType); 2901stackAllocType = Compilation.GetWellKnownType(WellKnownType.System_Span_T).Construct(elementType); 3127return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics)); 3213else if (WasImplicitReceiver(receiverOpt) && !(IsInsideNameof && Compilation.IsFeatureEnabled(MessageID.IDS_FeatureInstanceMemberInNameof)))
Binder\Binder_Crefs.cs (2)
1167Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 1168this.Compilation.GetBinderFactory(typeSyntax.SyntaxTree).GetBinder(typeSyntax).Flags ==
Binder\Binder_Deconstruct.cs (6)
46.CheckFeatureAvailability(diagnostics, Compilation, node.Location); 55.CheckFeatureAvailability(diagnostics, Compilation, node.Location); 331GenerateImplicitConversionError(diagnostics, Compilation, single.Syntax, nestedConversion, tupleOrDeconstructedTypes[i], single.Type); 539compilation: Compilation, 582bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 587tupleNames, this.Compilation,
Binder\Binder_Expressions.cs (67)
38if (!isExplicit && IsInsideNameof && Compilation.IsFeatureEnabled(MessageID.IDS_FeatureInstanceMemberInNameof)) 251return new ExtendedErrorTypeSymbol(this.Compilation, name, arity: 0, errorInfo: null, unreported: false); 355SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, trueSymbol, falseSymbol); 1013bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 1022Compilation, 1101bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 1104this.Compilation, syntax: node, diagnostics: diagnostics, shouldCheckConstraints: true, 1109NamedTypeSymbol.VerifyTupleTypePresent(elements.Length, node, this.Compilation, diagnostics); 1259TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference); 1307TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference); 1468bool typeHasErrors = type.IsErrorType() || CheckManagedAddr(Compilation, type, node.Location, diagnostics); 1484diagnostics.Add(ErrorCode.WRN_FieldIsAmbiguous, node, Compilation.LanguageVersion.ToDisplayString()); 1570if (Compilation.LanguageVersion >= requiredVersion) 2237this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true); 2300this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true); 2306isNullableUnknown = (type == (object)Compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType); 2453TypeSymbol hostObjectType = Compilation.GetHostObjectTypeSymbol(); 2887SymbolDistinguisher distinguisher1 = new SymbolDistinguisher(this.Compilation, operand.Type, targetType); 2962SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, operand.Type, targetType); 3136if (Compilation.FeatureStrictEnabled || !isDelegateCreation) 3456if (!hadLangVersionError && !Compilation.LanguageVersion.AllowNonTrailingNamedArguments()) 3984if (!Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters)) 4226var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank); 4248CheckManagedAddr(Compilation, bestType, node.Location, diagnostics, errorForManaged: true); 4460this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)), 4606hasErrors = hasErrors || CheckManagedAddr(Compilation, elementType.Type, elementTypeSyntax.Location, diagnostics, errorForManaged: true); 4668if (requiredVersion > Compilation.LanguageVersion) 5465type: @this.Compilation.GetSpecialType(SpecialType.System_Object)); 6481initializerType.ContainingModule != Compilation.SourceModule) 6827Debug.Assert((object)this.Compilation.Assembly != null); 6828return IsSymbolAccessibleConditional(constructor, this.Compilation.Assembly, ref useSiteInfo); 7176SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, coClassType, interfaceType); 7859type: Compilation.DynamicType, 8175Compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion()) 8454else if (boundLeft.Kind == BoundKind.AwaitableValuePlaceholder && boundLeft.Type.IsIAsyncEnumerableType(Compilation)) 8491TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncAction), TypeCompareKind.ConsiderEverything2) || 8492TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncActionWithProgress_T), TypeCompareKind.ConsiderEverything2) || 8493TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperation_T), TypeCompareKind.ConsiderEverything2) || 8494TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperationWithProgress_T2), TypeCompareKind.ConsiderEverything2); 8970&& method.ReduceExtensionMethod(receiverType, binder.Compilation) is null) 8975&& SourceNamedTypeSymbol.ReduceExtensionMember(binder.Compilation, method, receiverType, wasExtensionFullyInferred: out _) is null) 9088errorInfo = OverloadResolutionResult<Symbol>.CreateAmbiguousCallDiagnosticInfo(binder.Compilation, representativeMethod, representativeProperty, symbols, isExtension: true); 9208if ((object)Compilation.SourceModule != fieldSymbol.OriginalDefinition.ContainingModule && 9212if (!Compilation.Assembly.RuntimeSupportsByRefFields) 9334if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces && Compilation.SourceModule != symbol.ContainingModule) 9346else if (!Compilation.Assembly.RuntimeSupportsDefaultInterfaceImplementation && Compilation.SourceModule != symbol.ContainingModule) 9805if (!Compilation.Assembly.RuntimeSupportsInlineArrayTypes) 9818resultType = Compilation.GetWellKnownType( 9841int? constIndex = InferConstantIndexFromSystemIndex(Compilation, convertedIndex, length, out location); 10529TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Index), TypeCompareKind.ConsiderEverything) ? ThreeState.True : 10530TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything) ? ThreeState.False : 10662var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 10733var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 10734var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 11164var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true); 11170else if (m.ReduceExtensionMethod(receiver.Type, Compilation) is { } reduced) 11275if (Compilation.LanguageVersion < LanguageVersion.CSharp13) 11375var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true); 11443new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null), 11515var delegateType = Compilation.GetWellKnownType(wkDelegateType); 11520if (checkConstraints(Compilation, Conversions, delegateType, typeArguments)) 11546return Compilation.AnonymousTypeManager.ConstructAnonymousDelegateSymbol(typeDescr); 11688resultIsUsed = (((SimpleLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation); 11692resultIsUsed = (((ParenthesizedLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation); 11696resultIsUsed = (((ArrowExpressionClauseSyntax)parent).Expression != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
Binder\Binder_Flags.cs (1)
100var withoutUnsafe = isIteratorBody && this.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefUnsafeInIteratorAsync);
Binder\Binder_Initializers.cs (1)
254if (binder.Compilation.IsSubmission)
Binder\Binder_InterpolatedString.cs (9)
32if (startText.StartsWith("@$\"") && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureAltInterpolatedVerbatimStrings)) 53var newLinesInInterpolationsAllowed = this.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNewLinesInInterpolations); 85this.Compilation.LanguageVersion.ToDisplayString(), 284var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 400value = GenerateConversionForAssignment(Compilation.ObjectType, value, diagnostics); 450var interpolatedStringHandlerType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_DefaultInterpolatedStringHandler); 664else if (!Compilation.IsFeatureEnabled(MessageID.IDS_FeatureImprovedInterpolatedStrings) && diagnostics.AccumulatesDiagnostics) 998var expected = builderPatternExpectsBool == true ? Compilation.GetSpecialType(SpecialType.System_Boolean) : Compilation.GetSpecialType(SpecialType.System_Void);
Binder\Binder_Invocation.cs (19)
269if (IsInAsyncMethod() && Compilation.IsRuntimeAsyncEnabledIn(ContainingMemberOrLambda)) 393CheckRestrictedTypeReceiver(result, this.Compilation, diagnostics); 500type: Compilation.DynamicType, 512if (!Compilation.LanguageVersion.AllowNonTrailingNamedArguments()) 1038(typeArgumentsOpt.IsDefault || ((MethodSymbol)(object)result.Member).CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, candidateDiagnostics)))) 1457if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_UnknownWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol) 1466if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_DispatchWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol) 1475if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Type__Missing, diagnostics, syntax: syntax) is FieldSymbol fieldSymbol) 1695defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true }; 1699string path = callerSourceLocation.SourceTree.GetDisplayPath(callerSourceLocation.SourceSpan, Compilation.Options.SourceReferenceResolver); 1700defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1705defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1710&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists 1713defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true }; 1735TypeSymbol constantType = Compilation.GetSpecialType(defaultConstantValue.SpecialType); 1854if (Compilation.SourceModule != paramsParameter.ContainingModule) 2083var returnType = GetCommonTypeOrReturnType(methods) ?? new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null); 2326TypeSymbol returnType = new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null); 2433return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
Binder\Binder_Lambda.cs (4)
196ReportUseSiteDiagnosticForSynthesizedAttribute(Compilation, 318refCustomModifiers = [CSharpCustomModifier.CreateRequired(Binder.GetWellKnownType(Compilation, WellKnownType.System_Runtime_InteropServices_InAttribute, diagnostics, syntax.Location))]; 381bool allowShadowingNames = binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions); 401binder.Compilation,
Binder\Binder_Lookup.cs (28)
335bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree); 338for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission) 342var isCurrentSubmission = submission == Compilation; 356submissionImports = ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetImports(declarationSyntax, basesBeingResolved); 390submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation); 466Compilation.MarkImportDirectiveAsUsed(directive); 766if (Compilation.IsEqualOrDerivedFromWellKnownClass(namedType, WellKnownType.System_Attribute, ref useSiteInfo)) 914var error = new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagInfo, unreported: true); 926currentType = currentType.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, this.Compilation, ref visited); 1033idictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IDictionary_KV); 1034iroDictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IReadOnlyDictionary_KV); 1035iListSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_IList); 1036iCollectionSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_ICollection); 1037inccSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Specialized_INotifyCollectionChanged); 1038inpcSymbol = Compilation.GetWellKnownType(WellKnownType.System_ComponentModel_INotifyPropertyChanged); 1235this.LookupMembersInClass(tmp, this.Compilation.GetSpecialType(SpecialType.System_Object), name, arity, basesBeingResolved, options, originalBinder, type, diagnose, ref useSiteInfo); 1327if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) && 1424if ((object)symbol.DeclaringCompilation != this.Compilation 1485else if (!this.Compilation.SourceModule.Equals(unwrappedSymbol.ContainingModule) && unwrappedSymbol.IsHiddenByCodeAnalysisEmbeddedAttribute()) 1540diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_FriendRefNotEqualToThis, unwrappedSymbol.ContainingAssembly.Identity.ToString(), AssemblyIdentity.PublicKeyToString(this.Compilation.Assembly.PublicKey)); 1588var assemblyName = this.Compilation.AssemblyName; 1599ImmutableArray<byte> publicKey = this.Compilation.Assembly.PublicKey; 1725return !IsEffectivelyPrivate(symbol) || symbol.ContainingAssembly == this.Compilation.Assembly; 1969for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission) 1976bool isCurrentSubmission = submission == Compilation; 1984submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation); 2090type = type.GetNextBaseTypeNoUseSiteDiagnostics(null, this.Compilation, ref visited); 2107this.AddMemberLookupSymbolsInfoInClass(result, Compilation.GetSpecialType(SpecialType.System_Object), options, originalBinder, accessThroughType);
Binder\Binder_NameConflicts.cs (1)
121bool allowShadowing = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions);
Binder\Binder_Operators.cs (16)
76var finalDynamicConversion = this.Compilation.Conversions.ClassifyConversionFromExpression(placeholder, left.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo); 89Compilation.DynamicType), 492if (Compilation.SourceModule != method.ContainingModule) 727if (!eventSymbol.OriginalDefinition.IsFromCompilation(this.Compilation)) 854type: Compilation.DynamicType, 1386return type is NamedTypeSymbol namedType && Compilation.IsReadOnlySpanType(namedType) && 1613var booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean); 2232operatorMethod.ContainingModule != Compilation.SourceModule) 3580if (Compilation.SourceModule != method.ContainingModule) 3989if (Compilation.SourceModule != methodOpt.ContainingModule) 3993if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces) 4017if (Compilation.SourceModule != methodOpt.ContainingModule) 4139hasErrors = CheckManagedAddr(Compilation, operandType, managedKind, node.Location, diagnostics); 5430bool hasErrors = ReportAsOperatorConversionDiagnostics(node, diagnostics, this.Compilation, operandType, targetType, conversion.Kind, operand.ConstantValueOpt); 6036if (Compilation.Assembly.RuntimeSupportsNumericIntPtr) 6052if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
Binder\Binder_Patterns.cs (19)
60this.Compilation, pattern.Syntax, expression, innerPattern, whenTrueLabel: whenTrueLabel, whenFalseLabel: whenFalseLabel, diagnostics); 131if (!wasReported && diagnostics.AccumulatesDiagnostics && DecisionDagBuilder.EnableRedundantPatternsCheck(this.Compilation)) 133DecisionDagBuilder.CheckRedundantPatternsForIsPattern(this.Compilation, pattern.Syntax, expression, pattern, diagnostics); 375hasErrors |= !TryGetSpecialTypeMember(Compilation, SpecialMember.System_Array__Length, node, diagnostics, out PropertySymbol lengthProperty); 644if (Compilation.LanguageVersion < requiredVersion && !patternExpressionConversion.IsImplicit) 666if (MessageID.IDS_FeatureSpanCharConstantPattern.CheckFeatureAvailability(diagnostics, Compilation, node.Location)) 786if (requiredVersion > Compilation.LanguageVersion) 790Compilation.LanguageVersion.ToDisplayString(), 1126var objectType = Compilation.GetSpecialType(SpecialType.System_Object); 1153var objectType = Compilation.GetSpecialType(SpecialType.System_Object); 1258if (Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()) 1263iTupleType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_ITuple); 1272if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) && 1273declType != (object)Compilation.DynamicType && 1281iTupleGetLength = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length); 1282iTupleGetItem = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item); 1299var result = Compilation.Conversions.ClassifyBuiltInConversion(type, possibleBaseInterface, isChecked: CheckOverflowAtRuntime, ref useSiteInfo).IsImplicit; 1336|| (inputType.IsPointerType() && Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())) 1369var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
Binder\Binder_Query.cs (1)
818AnonymousTypeManager manager = this.Compilation.AnonymousTypeManager;
Binder\Binder_QueryErrors.cs (4)
89var ienumerable_t = Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T); 90var iqueryable_t = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable_T); 127var ienumerable = Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable); 128var iqueryable = Compilation.GetWellKnownType(WellKnownType.System_Linq_IQueryable);
Binder\Binder_Statements.cs (19)
174if (!this.Compilation.Options.AllowUnsafe) 270else if (InUnsafeRegion && Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefUnsafeInIteratorAsync)) 396if (Compilation.LanguageVersion < MessageID.IDS_FeatureSwitchExpression.RequiredVersion()) 413if ((object)type == null || !type.IsErrorType() && !Compilation.IsExceptionType(type.EffectiveType(ref useSiteInfo), ref useSiteInfo)) 641return method.ReturnsVoid || method.IsIterator || method.IsAsyncEffectivelyReturningTask(this.Compilation); 1315if (CheckManagedAddr(Compilation, elementType, initializerSyntax.Location, diagnostics)) 1380GenerateImplicitConversionError(diagnostics, this.Compilation, initializerSyntax, elementConversionClassification, pointerType, declType); 2062var reason = Conversions.IsAnonymousFunctionCompatibleWithType(anonymousFunction, targetType, this.Compilation); 2191this.Compilation)) 2249SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, lambdaParameterType, delegateParameterType); 2482GenerateImplicitConversionError(diagnostics, this.Compilation, syntax, conversion, sourceType, targetType, operand.ConstantValueOpt); 2994return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningTask(this.Compilation); 3000return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningGenericTask(this.Compilation); 3009return method.IsAsyncReturningIAsyncEnumerable(this.Compilation) || 3010method.IsAsyncReturningIAsyncEnumerator(this.Compilation); 3309if (!Compilation.IsExceptionType(effectiveType, ref useSiteInfo)) 3362else if (TypeSymbol.Equals(previousType, Compilation.GetWellKnownType(WellKnownType.System_Exception), TypeCompareKind.ConsiderEverything2) && 3363Compilation.SourceAssembly.RuntimeCompatibilityWrapNonExceptionThrows) 3835initializerInvocation = BindImplicitConstructorInitializer((MethodSymbol)this.ContainingMember(), diagnostics, Compilation);
Binder\Binder_Symbols.cs (38)
360return this.Compilation.Assembly.GlobalNamespace; 367return this.Compilation.GlobalNamespaceAlias; 554TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation); 560diagnostics.Add(new LazyUseSiteDiagnosticsInfoForNullableType(Compilation.LanguageVersion, constructedType), syntax.GetLocation()); 567type.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: true, location, diagnostics)); 569else if (GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(Compilation.LanguageVersion, constructedType) is { } diagnosticInfo) 608CheckManagedAddr(Compilation, elementType.Type, node.Location, diagnostics); 679var array = ArrayTypeSymbol.CreateCSharpArray(this.Compilation.Assembly, type, rankSpecifier.Rank); 732ReportMissingTupleElementNamesAttributesIfNeeded(Compilation, syntax.GetLocation(), diagnostics); 743bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes); 750this.Compilation, 844return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null)); 871Compilation.Assembly.GlobalNamespace, identifierValueText, 0, 899bindingResult = Compilation.DynamicType; 941if (Compilation.LanguageVersion < MessageID.IDS_FeatureDynamic.RequiredVersion()) 1053if (!Compilation.HasDynamicEmitAttributes(bag, node.Location)) 1341return new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagnosticInfo, unreported: false); 1378var binder = !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureUsingTypeAlias) 1592&& extensionMethod.ReduceExtensionMethod(receiverType, Compilation) is { } reduced) 1600if (SourceNamedTypeSymbol.ReduceExtensionMember(this.Compilation, symbol, receiverType, wasExtensionFullyInferred: out _) is { } compatibleSubstitutedMember) 1641bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes); 1642type.CheckConstraintsForNamedType(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability, typeSyntax.Location, diagnostics), 1711return GetSpecialType(this.Compilation, typeId, node, diagnostics); 1736return GetSpecialTypeMember(this.Compilation, member, diagnostics, syntax); 1839return GetWellKnownType(this.Compilation, type, diagnostics, location); 1884NamedTypeSymbol typeSymbol = this.Compilation.GetWellKnownType(type); 1892return GetWellKnownTypeMember(Compilation, member, diagnostics, location, syntax, isOptional); 2003if (container is object && container != Compilation.Assembly && container != Compilation.Assembly.CorLibrary) 2228if (ns.ContainingAssembly == Compilation.Assembly) 2240Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly); 2283Compilation.IsAttributeType((NamedTypeSymbol)first) && 2284Compilation.IsAttributeType((NamedTypeSymbol)second)) 2342((SourceModuleSymbol)this.Compilation.SourceModule).AnyReferencedAssembliesAreLinked) 2397return new ExtendedErrorTypeSymbol(qualifierOpt ?? Compilation.Assembly.GlobalNamespace, simpleName, arity, info); 2559var compilation = this.Compilation; 2661if (ReferenceEquals(qualifierOpt, Compilation.GlobalNamespace)) 2717Compilation.Assembly.Modules[0].GetReferencedAssemblySymbols())
Binder\Binder_TupleOperators.cs (2)
198TypeSymbol dynamicType = hasError ? CreateErrorType() : Compilation.DynamicType; 250var compilation = this.Compilation;
Binder\Binder_Unsafe.cs (1)
65else if (this.IsIndirectlyInIterator && MessageID.IDS_FeatureRefUnsafeInIteratorAsync.GetFeatureAvailabilityDiagnosticInfo(Compilation) is { } unsafeInIteratorDiagnosticInfo)
Binder\BinderFactory.BinderFactoryVisitor.cs (2)
912container = outer.Compilation.GlobalNamespace; 920outer = AddInImportsBinders((SourceNamespaceSymbol)outer.Compilation.SourceModule.GetModuleNamespace(ns), namespaceDecl, outer, inUsing);
Binder\BuckStopsHereBinder.cs (1)
70return IsSymbolAccessibleConditional(symbol, Compilation.Assembly, ref useSiteInfo);
Binder\ForEachLoopBinder.cs (18)
244messageId.CheckFeatureAvailability(diagnostics, Compilation, collectionExpr.Syntax.Location); 502SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, inferredType.Type, iterationVariableType.Type); 588IsIEnumerableT(builder.CollectionType.OriginalDefinition, IsAsync, Compilation) || 1080this.Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T) : 1081this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)); 1104getEnumeratorMethod = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerable_T__GetAsyncEnumerator, 1140Debug.Assert(enumeratorType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T))); 1150currentPropertyGetter = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, diagnostics, errorLocationSyntax.Location, isOptional: false); 1270NamedTypeSymbol targetInterface = isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable); 1280enumeratorType.ContainingModule != Compilation.SourceModule && 1281!LocalRewriter.CanRewriteForEachAsFor(Compilation, syntax, collectionType, out _, out _, BindingDiagnosticBag.Discarded)) 1317TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2)); 1775return type.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T)); 1798NamedTypeSymbol implementedIEnumerable = GetIEnumerableOfT(type, isAsync, Compilation, ref useSiteInfo, out foundMultiple, out bool needSupportForRefStructInterfaces); 1807var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable); 1816if (implementedIEnumerable is not null && needSupportForRefStructInterfaces && type.ContainingModule != Compilation.SourceModule && 1817!LocalRewriter.CanRewriteForEachAsFor(Compilation, collectionSyntax, type, out _, out _, BindingDiagnosticBag.Discarded))
Binder\HostObjectModeBinder.cs (1)
24TypeSymbol result = this.Compilation.GetHostObjectTypeSymbol();
Binder\InContainerBinder.cs (2)
48return ((object)merged != null) ? merged.GetConstituentForCompilation(this.Compilation) : _container; 104return TypeWithAnnotations.Create(this.Compilation.GetSpecialType(SpecialType.System_Object));
Binder\InMethodBinder.cs (1)
139var elementType = GetIteratorElementTypeFromReturnType(Compilation, refKind, returnType, errorLocation: null, diagnostics: null);
Binder\InSubmissionClassBinder.cs (3)
41for (var submission = this.Compilation; submission != null; submission = submission.PreviousSubmission) 60internal override ImmutableArray<AliasAndExternAliasDirective> ExternAliases => ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetExternAliases(_declarationSyntax); 62internal override ImmutableArray<AliasAndUsingDirective> UsingAliases => ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetUsingAliases(_declarationSyntax, basesBeingResolved: null);
Binder\LockBinder.cs (2)
46if (expr.ConstantValueOpt != ConstantValue.Null || Compilation.FeatureStrictEnabled) // Dev10 allows the null literal. 52else if (!exprType.IsReferenceType && (exprType.IsValueType || Compilation.FeatureStrictEnabled))
Binder\Semantics\Conversions\Conversions.cs (3)
25: base(binder.Compilation.Assembly.CorLibrary, currentRecursionDepth, includeNullability, otherNullabilityOpt) 36protected override CSharpCompilation Compilation { get { return _binder.Compilation; } } 258GetDelegateOrFunctionPointerArguments(source.Syntax, analyzedArguments, delegateInvokeMethodOpt.Parameters, binder.Compilation);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
393TypeSymbol systemDelegateType = _binder.Compilation.GetSpecialType(SpecialType.System_Delegate);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
302binder.Compilation, 1513Conversions.GetDelegateOrFunctionPointerArguments(source.Syntax, analyzedArguments, delegateParameters, binder.Compilation);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (10)
40get { return _binder.Compilation; } 55bool value = _binder.Compilation.FeatureStrictEnabled; 1321(binder.Compilation.LanguageVersion > LanguageVersion.CSharp12 || member.ContainingModule == binder.Compilation.SourceModule))) 1340var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(binder.Compilation, type, out elementType); 2974if (_binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureImprovedInterpolatedStrings) && 3983if (argRefKind == RefKind.Ref && binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters)) 3993else if (AreRefsCompatibleForMethodConversion(candidateMethodParameterRefKind: paramRefKind, delegateParameterRefKind: argRefKind, binder.Compilation)) 4457var extensionTypeArguments = MethodTypeInferrer.InferTypeArgumentsFromReceiverType(member.ContainingType, args[0], _binder.Compilation, _binder.Conversions, ref useSiteInfo); 4468_binder.Compilation,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
241if (HadAmbiguousBestMethods(binder.Compilation, diagnostics, symbols, location, isExtension)) 264if (HadAmbiguousWorseMethods(binder.Compilation, diagnostics, symbols, location, queryClause != null, receiver, name, isExtension)) 341if (HadConstructedParameterFailedConstraintCheck(binder.Conversions, binder.Compilation, diagnostics, location)) 1295!(refArg == RefKind.Ref && refParameter == RefKind.In && binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters)) && 1306else if (refArg == RefKind.Ref && refParameter == RefKind.In && !binder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters)) 1314binder.Compilation.LanguageVersion.ToDisplayString(), 1384SymbolDistinguisher distinguisher = new SymbolDistinguisher(binder.Compilation, displayArg, unwrapIfParamsCollection(badArg, parameter, isLastParameter));
Binder\SwitchBinder_Patterns.cs (3)
46compilation: this.Compilation, 61if (!wasReported && diagnostics.AccumulatesDiagnostics && DecisionDagBuilder.EnableRedundantPatternsCheck(this.Compilation)) 63DecisionDagBuilder.CheckRedundantPatternsForSwitchStatement(this.Compilation, syntax: node, boundSwitchGoverningExpression, switchSections, diagnostics);
Binder\SwitchExpressionBinder.cs (3)
42if (!wasReported && diagnostics.AccumulatesDiagnostics && DecisionDagBuilder.EnableRedundantPatternsCheck(this.Compilation)) 44DecisionDagBuilder.CheckRedundantPatternsForSwitchExpression(this.Compilation, node, boundInputExpression, switchArms, diagnostics); 72decisionDag = DecisionDagBuilder.CreateDecisionDagForSwitchExpression(this.Compilation, node, boundInputExpression, switchArms, defaultLabel, diagnostics);
Binder\UsingStatementBinder.cs (5)
207MessageID.IDS_FeatureDisposalPattern.CheckFeatureAvailability(diagnostics, originalBinder.Compilation, syntax.Location); 251awaitableType = originalBinder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_ValueTask); 294(fromExpression ? expressionOpt!.Type : declarationTypeOpt)!.ContainingModule != originalBinder.Compilation.SourceModule) 305? originalBinder.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) 306: originalBinder.Compilation.GetSpecialType(SpecialType.System_IDisposable);
Binder\WithExternAndUsingAliasesBinder.cs (1)
178foreach (var declaration in ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).MergedDeclaration.Declarations)
BoundTree\UnboundLambda.cs (10)
156var compilation = Binder.Compilation; 238var useSiteInfo = withDependencies ? new CompoundUseSiteInfo<AssemblySymbol>(binder.Compilation.Assembly) : CompoundUseSiteInfo<AssemblySymbol>.DiscardedDependencies; 334binder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task); 349binder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T); 803returnType = TypeWithAnnotations.Create(Binder.Compilation.GetSpecialType(SpecialType.System_Void)); 828var compilation = Binder.Compilation; 895if (Binder.MethodOrLambdaRequiresValue(lambdaSymbol, this.Binder.Compilation)) 933Binder.Compilation, 1015? TypeWithAnnotations.Create(this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)) 1271? this.Binder.Compilation.GetSpecialType(SpecialType.System_Void)
BoundTree\VariablePendingInference.cs (1)
45type = TypeWithAnnotations.Create(binderOpt!.Compilation.ImplicitlyTypedVariableInferenceFailedType);
Compilation\CSharpSemanticModel.cs (4)
1697if (SourceNamedTypeSymbol.ReduceExtensionMember(binder.Compilation, symbol, receiverType, wasExtensionFullyInferred: out _) is { } compatibleSubstitutedMember) 4604binder.Compilation); 4619binder.Compilation); 4666binder.Compilation);
Compiler\MethodCompiler.cs (1)
1950var compilation = bodyBinder.Compilation;
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
75var code = tree.IsGeneratedCode(binder.Compilation.Options.SyntaxTreeOptionsProvider, CancellationToken.None)
FlowAnalysis\NullableWalker.cs (4)
1686binder.Compilation, 1761var compilation = binder.Compilation; 5136var walker = new NullableWalker(binder.Compilation, 5178reportRemainingWarnings: false, reportTopLevelWarnings: false).ToTypeWithAnnotations(binder.Compilation);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
26CallingConvention callingConvention = getCallingConvention(typeBinder.Compilation, syntax.CallingConvention, customModifiers, diagnostics);
Symbols\FunctionTypeSymbol.cs (1)
88if (_binder.Compilation.TestOnlyCompilationData is InferredDelegateTypeData data &&
Symbols\Source\LocalFunctionSymbol.cs (1)
45Debug.Assert(containingSymbol.DeclaringCompilation == binder.Compilation);
Symbols\Source\ParameterHelpers.cs (1)
228bool allowShadowingNames = withTypeParametersBinder.Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNameShadowingInNestedFunctions) &&
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
80if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error && 81binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
Symbols\Source\SourceLocalSymbol.cs (1)
84Debug.Assert(containingSymbol.DeclaringCompilation == scopeBinder.Compilation);
Symbols\Source\SourceParameterSymbol.cs (1)
52Binder.ReportUseSiteDiagnosticForSynthesizedAttribute(context.Compilation,
Symbols\Symbol_Attributes.cs (1)
868if (!boundAttribute.HasErrors && ValidateAttributeUsage(boundAttribute, attributeSyntax, binder.Compilation, symbolPart, diagnostics, uniqueAttributeTypes))