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_Conversions.cs (30)
484if (Compilation.SourceModule != method.ContainingModule)
488if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces)
496Compilation.SourceModule != method.ContainingModule)
508(Compilation.SourceModule != method.ContainingModule) &&
509!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces)
516if (!Compilation.Assembly.RuntimeSupportsInlineArrayTypes)
530if (destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions))
545Debug.Assert(destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions));
616.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics));
624TryFindAsSpanCharMethod(Compilation, destination),
786Debug.Assert(destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) ||
787destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_FormattableString), TypeCompareKind.ConsiderEverything));
976if (LocalRewriter.IsAllocatingRefStructCollectionExpression(_node, collectionTypeKind, elementType, _binder.Compilation))
1029if (_targetType.OriginalDefinition.Equals(_binder.Compilation.GetWellKnownType(WellKnownType.System_Collections_Immutable_ImmutableArray_T), TypeCompareKind.ConsiderEverything))
1300var list_T__ctor = (MethodSymbol?)@this._binder.Compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_List_T__ctor);
1301var list_T__ctorInt32 = (MethodSymbol?)@this._binder.Compilation.GetWellKnownTypeMember(WellKnownMember.System_Collections_Generic_List_T__ctorInt32);
1541var readOnlySpanType = Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T);
1637Debug.Assert(parameterType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions));
1642Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics));
1851var elementPlaceholder = new BoundValuePlaceholder(syntax, Compilation.DynamicType) { WasCompilerGenerated = true };
2099member, receiverType, addMethodBinder.Compilation, ref useSiteInfo, out wasFullyInferred);
2359var collectionTypeKind = ConversionsBase.GetCollectionExpressionTypeKind(Compilation, targetType, out TypeWithAnnotations elementTypeWithAnnotations);
2419GenerateImplicitConversionError(diagnostics, this.Compilation, spreadElement.Expression.Syntax, elementConversion, enumeratorInfo.ElementType, elementType);
2473if (targetTyped && !destination.IsErrorType() && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureTargetTypedConditional))
2478Compilation.LanguageVersion.ToDisplayString(),
2852delegateType = Compilation.GetWellKnownType(WellKnownType.System_Linq_Expressions_Expression_T).Construct(delegateType);
3110if (Compilation.SourceModule.UseUpdatedMemorySafetyRules &&
3118stackAllocType = Compilation.GetWellKnownType(WellKnownType.System_Span_T).Construct(elementType);
3344return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics));
3430else if (WasImplicitReceiver(receiverOpt) && !(IsInsideNameof && Compilation.IsFeatureEnabled(MessageID.IDS_FeatureInstanceMemberInNameof)))
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)
2238this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true);
2301this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true);
2307isNullableUnknown = (type == (object)Compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType);
2454TypeSymbol hostObjectType = Compilation.GetHostObjectTypeSymbol();
2888SymbolDistinguisher distinguisher1 = new SymbolDistinguisher(this.Compilation, operand.Type, targetType);
2963SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, operand.Type, targetType);
3137if (Compilation.FeatureStrictEnabled || !isDelegateCreation)
3457if (!hadLangVersionError && !Compilation.LanguageVersion.AllowNonTrailingNamedArguments())
3985if (!Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters))
4227var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank);
4249CheckManagedAddr(Compilation, bestType, node.Location, diagnostics, errorForManaged: true);
4461this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)),
4607hasErrors = hasErrors || CheckManagedAddr(Compilation, elementType.Type, elementTypeSyntax.Location, diagnostics, errorForManaged: true);
4669if (requiredVersion > Compilation.LanguageVersion)
5469type: @this.Compilation.GetSpecialType(SpecialType.System_Object));
6461initializerType.ContainingModule != Compilation.SourceModule)
6807Debug.Assert((object)this.Compilation.Assembly != null);
6808return IsSymbolAccessibleConditional(constructor, this.Compilation.Assembly, ref useSiteInfo);
7163SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, coClassType, interfaceType);
7851type: Compilation.DynamicType,
8168Compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())
8447else if (boundLeft.Kind == BoundKind.AwaitableValuePlaceholder && boundLeft.Type.IsIAsyncEnumerableType(Compilation))
8484TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncAction), TypeCompareKind.ConsiderEverything2) ||
8485TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncActionWithProgress_T), TypeCompareKind.ConsiderEverything2) ||
8486TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperation_T), TypeCompareKind.ConsiderEverything2) ||
8487TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperationWithProgress_T2), TypeCompareKind.ConsiderEverything2);
8974&& method.ReduceExtensionMethod(receiverType, binder.Compilation) is null)
8979&& SourceNamedTypeSymbol.ReduceExtensionMember(binder.Compilation, method, receiverType, wasExtensionFullyInferred: out _) is null)
9092errorInfo = OverloadResolutionResult<Symbol>.CreateAmbiguousCallDiagnosticInfo(binder.Compilation, representativeMethod, representativeProperty, symbols, isExtension: true);
9212if ((object)Compilation.SourceModule != fieldSymbol.OriginalDefinition.ContainingModule &&
9216if (!Compilation.Assembly.RuntimeSupportsByRefFields)
9343if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces && Compilation.SourceModule != symbol.ContainingModule)
9355else if (!Compilation.Assembly.RuntimeSupportsDefaultInterfaceImplementation && Compilation.SourceModule != symbol.ContainingModule)
9832if (!Compilation.Assembly.RuntimeSupportsInlineArrayTypes)
9845resultType = Compilation.GetWellKnownType(
9868int? constIndex = InferConstantIndexFromSystemIndex(Compilation, convertedIndex, length, out location);
10558TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Index), TypeCompareKind.ConsiderEverything) ? ThreeState.True :
10559TypeSymbol.Equals(argType, Compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything) ? ThreeState.False :
10691var intPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10762var startArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
10763var lengthArgumentPlaceholder = new BoundImplicitIndexerValuePlaceholder(syntax, Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
11193var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true);
11199else if (m.ReduceExtensionMethod(receiver.Type, Compilation) is { } reduced)
11304if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
11404var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true);
11472new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null),
11544var delegateType = Compilation.GetWellKnownType(wkDelegateType);
11549if (checkConstraints(Compilation, Conversions, delegateType, typeArguments))
11575return Compilation.AnonymousTypeManager.ConstructAnonymousDelegateSymbol(typeDescr);
11717resultIsUsed = (((SimpleLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
11721resultIsUsed = (((ParenthesizedLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
11725resultIsUsed = (((ArrowExpressionClauseSyntax)parent).Expression != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
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))))
1458if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_UnknownWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol)
1467if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_DispatchWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol)
1476if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Type__Missing, diagnostics, syntax: syntax) is FieldSymbol fieldSymbol)
1696defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
1700string path = callerSourceLocation.SourceTree.GetDisplayPath(callerSourceLocation.SourceSpan, Compilation.Options.SourceReferenceResolver);
1701defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1706defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1711&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists
1714defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1736TypeSymbol constantType = Compilation.GetSpecialType(defaultConstantValue.SpecialType);
1855if (Compilation.SourceModule != paramsParameter.ContainingModule)
2084var returnType = GetCommonTypeOrReturnType(methods) ?? new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2327TypeSymbol returnType = new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2434return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
Binder\Binder_Lookup.cs (28)
307bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree);
310for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission)
314var isCurrentSubmission = submission == Compilation;
328submissionImports = ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetImports(declarationSyntax, basesBeingResolved);
362submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation);
438Compilation.MarkImportDirectiveAsUsed(directive);
738if (Compilation.IsEqualOrDerivedFromWellKnownClass(namedType, WellKnownType.System_Attribute, ref useSiteInfo))
886var error = new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagInfo, unreported: true);
898currentType = currentType.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, this.Compilation, ref visited);
1005idictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IDictionary_KV);
1006iroDictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IReadOnlyDictionary_KV);
1007iListSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_IList);
1008iCollectionSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_ICollection);
1009inccSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Specialized_INotifyCollectionChanged);
1010inpcSymbol = Compilation.GetWellKnownType(WellKnownType.System_ComponentModel_INotifyPropertyChanged);
1207this.LookupMembersInClass(tmp, this.Compilation.GetSpecialType(SpecialType.System_Object), name, arity, basesBeingResolved, options, originalBinder, type, diagnose, ref useSiteInfo);
1299if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) &&
1396if ((object)symbol.DeclaringCompilation != this.Compilation
1457else if (!this.Compilation.SourceModule.Equals(unwrappedSymbol.ContainingModule) && unwrappedSymbol.IsHiddenByCodeAnalysisEmbeddedAttribute())
1512diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_FriendRefNotEqualToThis, unwrappedSymbol.ContainingAssembly.Identity.ToString(), AssemblyIdentity.PublicKeyToString(this.Compilation.Assembly.PublicKey));
1560var assemblyName = this.Compilation.AssemblyName;
1571ImmutableArray<byte> publicKey = this.Compilation.Assembly.PublicKey;
1697return !IsEffectivelyPrivate(symbol) || symbol.ContainingAssembly == this.Compilation.Assembly;
1941for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission)
1948bool isCurrentSubmission = submission == Compilation;
1956submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation);
2062type = type.GetNextBaseTypeNoUseSiteDiagnostics(null, this.Compilation, ref visited);
2079this.AddMemberLookupSymbolsInfoInClass(result, Compilation.GetSpecialType(SpecialType.System_Object), options, originalBinder, accessThroughType);
Binder\Binder_Operators.cs (16)
76var finalDynamicConversion = this.Compilation.Conversions.ClassifyConversionFromExpression(placeholder, left.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo);
89Compilation.DynamicType),
489if (Compilation.SourceModule != method.ContainingModule)
724if (!eventSymbol.OriginalDefinition.IsFromCompilation(this.Compilation))
852type: Compilation.DynamicType,
1380return type is NamedTypeSymbol namedType && Compilation.IsReadOnlySpanType(namedType) &&
1603var booleanType = Compilation.GetSpecialType(SpecialType.System_Boolean);
2224operatorMethod.ContainingModule != Compilation.SourceModule)
3595if (Compilation.SourceModule != method.ContainingModule)
4006if (Compilation.SourceModule != methodOpt.ContainingModule)
4010if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces)
4034if (Compilation.SourceModule != methodOpt.ContainingModule)
4163hasErrors = CheckManagedAddr(Compilation, operandType, managedKind, node.Location, diagnostics);
5506bool hasErrors = ReportAsOperatorConversionDiagnostics(node, diagnostics, this.Compilation, operandType, targetType, conversion.Kind, operand.ConstantValueOpt);
6112if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
6128if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
Binder\Binder_Patterns.cs (20)
27inputType = GetUnionTypeValueProperty(unionTypeOverride, ref useSiteInfo)?.Type ?? Compilation.GetSpecialType(SpecialType.System_Object);
486this.Compilation, pattern.Syntax, expression, innerPattern, hasUnionMatching, whenTrueLabel: whenTrueLabel, whenFalseLabel: whenFalseLabel, diagnostics);
557if (!wasReported && diagnostics.AccumulatesDiagnostics && DecisionDagBuilder.EnableRedundantPatternsCheck(this.Compilation))
559DecisionDagBuilder.CheckRedundantPatternsForIsPattern(this.Compilation, pattern.Syntax, expression, pattern, hasUnionMatching, diagnostics);
824hasErrors |= !TryGetSpecialTypeMember(Compilation, SpecialMember.System_Array__Length, node, diagnostics, out PropertySymbol lengthProperty);
1132if (Compilation.LanguageVersion < requiredVersion && !patternExpressionConversion.IsImplicit)
1154if (MessageID.IDS_FeatureSpanCharConstantPattern.CheckFeatureAvailability(diagnostics, Compilation, node.Location))
1348if (requiredVersion > Compilation.LanguageVersion)
1352Compilation.LanguageVersion.ToDisplayString(),
1739var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1859if (Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
1864iTupleType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_ITuple);
1873if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) &&
1874declType != (object)Compilation.DynamicType &&
1882iTupleGetLength = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length);
1883iTupleGetItem = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item);
1904var result = Compilation.Conversions.ClassifyBuiltInConversion(type, possibleBaseInterface, isChecked: CheckOverflowAtRuntime, ref useSiteInfo).IsImplicit;
1943|| (inputType.IsPointerType() && Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()))
1979var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
2101var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
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);
3325if (!Compilation.IsExceptionType(effectiveType, ref useSiteInfo))
3378else if (TypeSymbol.Equals(previousType, Compilation.GetWellKnownType(WellKnownType.System_Exception), TypeCompareKind.ConsiderEverything2) &&
3379Compilation.SourceAssembly.RuntimeCompatibilityWrapNonExceptionThrows)
3863initializerInvocation = BindImplicitConstructorInitializer((MethodSymbol)this.ContainingMember(), diagnostics, Compilation);
Binder\Binder_Symbols.cs (38)
362return this.Compilation.Assembly.GlobalNamespace;
369return this.Compilation.GlobalNamespaceAlias;
556TypeWithAnnotations constructedType = typeArgument.SetIsAnnotated(Compilation);
562diagnostics.Add(new LazyUseSiteDiagnosticsInfoForNullableType(Compilation.LanguageVersion, constructedType), syntax.GetLocation());
569type.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: true, location, diagnostics));
571else if (GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(Compilation.LanguageVersion, constructedType) is { } diagnosticInfo)
610CheckManagedAddr(Compilation, elementType.Type, node.Location, diagnostics);
681var array = ArrayTypeSymbol.CreateCSharpArray(this.Compilation.Assembly, type, rankSpecifier.Rank);
734ReportMissingTupleElementNamesAttributesIfNeeded(Compilation, syntax.GetLocation(), diagnostics);
745bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes);
752this.Compilation,
846return TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(qualifierOpt ?? this.Compilation.Assembly.GlobalNamespace, string.Empty, arity: 0, errorInfo: null));
873Compilation.Assembly.GlobalNamespace, identifierValueText, 0,
901bindingResult = Compilation.DynamicType;
943if (Compilation.LanguageVersion < MessageID.IDS_FeatureDynamic.RequiredVersion())
1055if (!Compilation.HasDynamicEmitAttributes(bag, node.Location))
1344return new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagnosticInfo, unreported: false);
1381var binder = !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureUsingTypeAlias)
1595&& extensionMethod.ReduceExtensionMethod(receiverType, Compilation) is { } reduced)
1603if (SourceNamedTypeSymbol.ReduceExtensionMember(this.Compilation, symbol, receiverType, wasExtensionFullyInferred: out _) is { } compatibleSubstitutedMember)
1644bool includeNullability = Compilation.IsFeatureEnabled(MessageID.IDS_FeatureNullableReferenceTypes);
1645type.CheckConstraintsForNamedType(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability, typeSyntax.Location, diagnostics),
1715return GetSpecialType(this.Compilation, typeId, node, diagnostics);
1740return GetSpecialTypeMember(this.Compilation, member, diagnostics, syntax);
1843return GetWellKnownType(this.Compilation, type, diagnostics, location);
1888NamedTypeSymbol typeSymbol = this.Compilation.GetWellKnownType(type);
1896return GetWellKnownTypeMember(Compilation, member, diagnostics, location, syntax, isOptional);
2007if (container is object && container != Compilation.Assembly && container != Compilation.Assembly.CorLibrary)
2232if (ns.ContainingAssembly == Compilation.Assembly)
2244Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly);
2287Compilation.IsAttributeType((NamedTypeSymbol)first) &&
2288Compilation.IsAttributeType((NamedTypeSymbol)second))
2346((SourceModuleSymbol)this.Compilation.SourceModule).AnyReferencedAssembliesAreLinked)
2401return new ExtendedErrorTypeSymbol(qualifierOpt ?? Compilation.Assembly.GlobalNamespace, simpleName, arity, info);
2563var compilation = this.Compilation;
2665if (ReferenceEquals(qualifierOpt, Compilation.GlobalNamespace))
2721Compilation.Assembly.Modules[0].GetReferencedAssemblySymbols())
Binder\ForEachLoopBinder.cs (18)
244messageId.CheckFeatureAvailability(diagnostics, Compilation, collectionExpr.Syntax.Location);
504SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, inferredType.Type, iterationVariableType.Type);
590IsIEnumerableT(builder.CollectionType.OriginalDefinition, IsAsync, Compilation) ||
1083this.Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T) :
1084this.Compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T));
1107getEnumeratorMethod = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerable_T__GetAsyncEnumerator,
1143Debug.Assert(enumeratorType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T)));
1153currentPropertyGetter = (MethodSymbol)GetWellKnownTypeMember(Compilation, WellKnownMember.System_Collections_Generic_IAsyncEnumerator_T__get_Current, diagnostics, errorLocationSyntax.Location, isOptional: false);
1278NamedTypeSymbol targetInterface = isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable);
1288enumeratorType.ContainingModule != Compilation.SourceModule &&
1289!LocalRewriter.CanRewriteForEachAsFor(Compilation, syntax, collectionType, out _, out _, BindingDiagnosticBag.Discarded))
1325TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1784return type.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T));
1807NamedTypeSymbol implementedIEnumerable = GetIEnumerableOfT(type, isAsync, Compilation, ref useSiteInfo, out foundMultiple, out bool needSupportForRefStructInterfaces);
1816var implementedNonGeneric = this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerable);
1825if (implementedIEnumerable is not null && needSupportForRefStructInterfaces && type.ContainingModule != Compilation.SourceModule &&
1826!LocalRewriter.CanRewriteForEachAsFor(Compilation, collectionSyntax, type, out _, out _, BindingDiagnosticBag.Discarded))
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));