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 (29)
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);
3110stackAllocType = Compilation.GetWellKnownType(WellKnownType.System_Span_T).Construct(elementType);
3336return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics));
3422else 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 (65)
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);
1016bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames();
1025Compilation,
1104bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames();
1107this.Compilation, syntax: node, diagnostics: diagnostics, shouldCheckConstraints: true,
1112NamedTypeSymbol.VerifyTupleTypePresent(elements.Length, node, this.Compilation, diagnostics);
1262TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1310TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1471bool typeHasErrors = type.IsErrorType() || CheckManagedAddr(Compilation, type, node.Location, diagnostics);
1487diagnostics.Add(ErrorCode.WRN_FieldIsAmbiguous, node, Compilation.LanguageVersion.ToDisplayString());
1573if (Compilation.LanguageVersion >= requiredVersion)
2241this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true);
2304this.Compilation, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true);
2310isNullableUnknown = (type == (object)Compilation.ImplicitlyTypedVariableUsedInForbiddenZoneType);
2457TypeSymbol hostObjectType = Compilation.GetHostObjectTypeSymbol();
2891SymbolDistinguisher distinguisher1 = new SymbolDistinguisher(this.Compilation, operand.Type, targetType);
2966SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, operand.Type, targetType);
3140if (Compilation.FeatureStrictEnabled || !isDelegateCreation)
3460if (!hadLangVersionError && !Compilation.LanguageVersion.AllowNonTrailingNamedArguments())
3988if (!Compilation.IsFeatureEnabled(MessageID.IDS_FeatureRefReadonlyParameters))
4230var arrayType = ArrayTypeSymbol.CreateCSharpArray(Compilation.Assembly, TypeWithAnnotations.Create(bestType), rank);
4252CheckManagedAddr(Compilation, bestType, node.Location, diagnostics, errorForManaged: true);
4464this.Compilation.CreateArrayTypeSymbol(GetSpecialType(SpecialType.System_Object, diagnostics, node)),
4610hasErrors = hasErrors || CheckManagedAddr(Compilation, elementType.Type, elementTypeSyntax.Location, diagnostics, errorForManaged: true);
4672if (requiredVersion > Compilation.LanguageVersion)
5485type: @this.Compilation.GetSpecialType(SpecialType.System_Object));
6477initializerType.ContainingModule != Compilation.SourceModule)
6823Debug.Assert((object)this.Compilation.Assembly != null);
6824return IsSymbolAccessibleConditional(constructor, this.Compilation.Assembly, ref useSiteInfo);
7179SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, coClassType, interfaceType);
7623if (!this.Compilation.Options.AllowUnsafe)
7881type: Compilation.DynamicType,
8198Compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())
8477else if (boundLeft.Kind == BoundKind.AwaitableValuePlaceholder && boundLeft.Type.IsIAsyncEnumerableType(Compilation))
8514TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncAction), TypeCompareKind.ConsiderEverything2) ||
8515TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncActionWithProgress_T), TypeCompareKind.ConsiderEverything2) ||
8516TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperation_T), TypeCompareKind.ConsiderEverything2) ||
8517TypeSymbol.Equals(namedType, Compilation.GetWellKnownType(WellKnownType.Windows_Foundation_IAsyncOperationWithProgress_T2), TypeCompareKind.ConsiderEverything2);
9016errorInfo = OverloadResolutionResult<Symbol>.CreateAmbiguousCallDiagnosticInfo(binder.Compilation, representativeMethod, representativeProperty, symbols, isExtension: true);
9064&& method.ReduceExtensionMethod(receiverType, this.Compilation) is null)
9069&& SourceNamedTypeSymbol.ReduceExtensionMember(this.Compilation, method, receiverType, wasExtensionFullyInferred: out _) is null)
9324IndexOrRangeArgKind argKind = GetIndexOrRangeArgKind(arguments, binder.Compilation);
9895if ((object)Compilation.SourceModule != fieldSymbol.OriginalDefinition.ContainingModule &&
9899if (!Compilation.Assembly.RuntimeSupportsByRefFields)
10026if (!Compilation.Assembly.RuntimeSupportsStaticAbstractMembersInInterfaces && Compilation.SourceModule != symbol.ContainingModule)
10038else if (!Compilation.Assembly.RuntimeSupportsDefaultInterfaceImplementation && Compilation.SourceModule != symbol.ContainingModule)
10515if (!Compilation.Assembly.RuntimeSupportsInlineArrayTypes)
10528resultType = Compilation.GetWellKnownType(
10551int? constIndex = InferConstantIndexFromSystemIndex(Compilation, convertedIndex, length, out location);
11267IndexOrRangeArgKind argKind = GetIndexOrRangeArgKind(arguments, Compilation);
11895var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true);
11901else if (m.ReduceExtensionMethod(receiver.Type, Compilation) is { } reduced)
12006if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
12106var substituted = (MethodSymbol?)extensionMember.GetReducedAndFilteredSymbol(typeArguments, receiver.Type, Compilation, checkFullyInferred: true);
12174new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null),
12246var delegateType = Compilation.GetWellKnownType(wkDelegateType);
12251if (checkConstraints(Compilation, Conversions, delegateType, typeArguments))
12277return Compilation.AnonymousTypeManager.ConstructAnonymousDelegateSymbol(typeDescr);
12419resultIsUsed = (((SimpleLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
12423resultIsUsed = (((ParenthesizedLambdaExpressionSyntax)parent).Body != node) || MethodOrLambdaRequiresValue(ContainingMemberOrLambda, Compilation);
12427resultIsUsed = (((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())
1063(typeArgumentsOpt.IsDefault || ((MethodSymbol)(object)result.Member).CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, candidateDiagnostics))))
1483if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_UnknownWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol)
1492if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Runtime_InteropServices_DispatchWrapper__ctor, diagnostics, syntax: syntax) is MethodSymbol methodSymbol)
1501if (GetWellKnownTypeMember(Compilation, WellKnownMember.System_Type__Missing, diagnostics, syntax: syntax) is FieldSymbol fieldSymbol)
1721defaultValue = new BoundLiteral(syntax, ConstantValue.Create(line), Compilation.GetSpecialType(SpecialType.System_Int32)) { WasCompilerGenerated = true };
1725string path = callerSourceLocation.SourceTree.GetDisplayPath(callerSourceLocation.SourceSpan, Compilation.Options.SourceReferenceResolver);
1726defaultValue = new BoundLiteral(syntax, ConstantValue.Create(path), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1731defaultValue = new BoundLiteral(syntax, ConstantValue.Create(memberName), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1736&& Conversions.ClassifyBuiltInConversion(Compilation.GetSpecialType(SpecialType.System_String), parameterType, isChecked: false, ref discardedUseSiteInfo).Exists
1739defaultValue = new BoundLiteral(syntax, ConstantValue.Create(argument.Syntax.ToString()), Compilation.GetSpecialType(SpecialType.System_String)) { WasCompilerGenerated = true };
1761TypeSymbol constantType = Compilation.GetSpecialType(defaultConstantValue.SpecialType);
1880if (Compilation.SourceModule != paramsParameter.ContainingModule)
2109var returnType = GetCommonTypeOrReturnType(methods) ?? new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2352TypeSymbol returnType = new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2459return new BoundNameOfOperator(node, boundArgument, ConstantValue.Create(name), Compilation.GetSpecialType(SpecialType.System_String));
Binder\Binder_Lookup.cs (28)
363bool isSubmissionTree = Compilation.IsSubmissionSyntaxTree(declarationSyntax.SyntaxTree);
366for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission)
370var isCurrentSubmission = submission == Compilation;
384submissionImports = ((SourceNamespaceSymbol)Compilation.SourceModule.GlobalNamespace).GetImports(declarationSyntax, basesBeingResolved);
418submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation);
494Compilation.MarkImportDirectiveAsUsed(directive);
794if (Compilation.IsEqualOrDerivedFromWellKnownClass(namedType, WellKnownType.System_Attribute, ref useSiteInfo))
942var error = new ExtendedErrorTypeSymbol(this.Compilation, name, arity, diagInfo, unreported: true);
954currentType = currentType.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, this.Compilation, ref visited);
1061idictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IDictionary_KV);
1062iroDictSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IReadOnlyDictionary_KV);
1063iListSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_IList);
1064iCollectionSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_ICollection);
1065inccSymbol = Compilation.GetWellKnownType(WellKnownType.System_Collections_Specialized_INotifyCollectionChanged);
1066inpcSymbol = Compilation.GetWellKnownType(WellKnownType.System_ComponentModel_INotifyPropertyChanged);
1263this.LookupMembersInClass(tmp, this.Compilation.GetSpecialType(SpecialType.System_Object), name, arity, basesBeingResolved, options, originalBinder, type, diagnose, ref useSiteInfo);
1355if (!IsDerivedType(baseType: hiddenContainer, derivedType: hidingSym.ContainingType, basesBeingResolved, this.Compilation, useSiteInfo: ref useSiteInfo) &&
1452if ((object)symbol.DeclaringCompilation != this.Compilation
1513else if (!this.Compilation.SourceModule.Equals(unwrappedSymbol.ContainingModule) && unwrappedSymbol.IsHiddenByCodeAnalysisEmbeddedAttribute())
1568diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_FriendRefNotEqualToThis, unwrappedSymbol.ContainingAssembly.Identity.ToString(), AssemblyIdentity.PublicKeyToString(this.Compilation.Assembly.PublicKey));
1616var assemblyName = this.Compilation.AssemblyName;
1627ImmutableArray<byte> publicKey = this.Compilation.Assembly.PublicKey;
1753return !IsEffectivelyPrivate(symbol) || symbol.ContainingAssembly == this.Compilation.Assembly;
1997for (CSharpCompilation submission = Compilation; submission != null; submission = submission.PreviousSubmission)
2004bool isCurrentSubmission = submission == Compilation;
2012submissionImports = Imports.ExpandPreviousSubmissionImports(submissionImports, Compilation);
2118type = type.GetNextBaseTypeNoUseSiteDiagnostics(null, this.Compilation, ref visited);
2135this.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);
5482bool hasErrors = ReportAsOperatorConversionDiagnostics(node, diagnostics, this.Compilation, operandType, targetType, conversion.Kind, operand.ConstantValueOpt);
6088if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
6104if (Compilation.Assembly.RuntimeSupportsNumericIntPtr)
Binder\Binder_Patterns.cs (19)
29inputType = GetUnionTypeValueProperty(unionTypeOverride, ref useSiteInfo)?.Type ?? Compilation.GetSpecialType(SpecialType.System_Object);
578this.Compilation, pattern.Syntax, expression, innerPattern, hasUnionMatching, whenTrueLabel: whenTrueLabel, whenFalseLabel: whenFalseLabel, diagnostics);
649if (!wasReported && diagnostics.AccumulatesDiagnostics && DecisionDagBuilder.EnableRedundantPatternsCheck(this.Compilation))
651DecisionDagBuilder.CheckRedundantPatternsForIsPattern(this.Compilation, pattern.Syntax, expression, pattern, hasUnionMatching, diagnostics);
1230if (Compilation.LanguageVersion < requiredVersion && !patternExpressionConversion.IsImplicit)
1252if (MessageID.IDS_FeatureSpanCharConstantPattern.CheckFeatureAvailability(diagnostics, Compilation, node.Location))
1449if (requiredVersion > Compilation.LanguageVersion)
1453Compilation.LanguageVersion.ToDisplayString(),
1854var objectType = Compilation.GetSpecialType(SpecialType.System_Object);
1974if (Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
1979iTupleType = Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_ITuple);
1988if (declType != (object)Compilation.GetSpecialType(SpecialType.System_Object) &&
1989declType != (object)Compilation.DynamicType &&
1997iTupleGetLength = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Length);
1998iTupleGetItem = (MethodSymbol?)Compilation.GetWellKnownTypeMember(WellKnownMember.System_Runtime_CompilerServices_ITuple__get_Item);
2019var result = Compilation.Conversions.ClassifyBuiltInConversion(type, possibleBaseInterface, isChecked: CheckOverflowAtRuntime, ref useSiteInfo).IsImplicit;
2058|| (inputType.IsPointerType() && Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()))
2094var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
2219var 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);
2063var reason = Conversions.IsAnonymousFunctionCompatibleWithType(anonymousFunction, targetType, this.Compilation);
2192this.Compilation))
2250SymbolDistinguisher distinguisher = new SymbolDistinguisher(this.Compilation, lambdaParameterType, delegateParameterType);
2483GenerateImplicitConversionError(diagnostics, this.Compilation, syntax, conversion, sourceType, targetType, operand.ConstantValueOpt);
3019return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningTask(this.Compilation);
3025return symbol?.Kind == SymbolKind.Method && ((MethodSymbol)symbol).IsAsyncEffectivelyReturningGenericTask(this.Compilation);
3034return method.IsAsyncReturningIAsyncEnumerable(this.Compilation) ||
3035method.IsAsyncReturningIAsyncEnumerator(this.Compilation);
3350if (!Compilation.IsExceptionType(effectiveType, ref useSiteInfo))
3403else if (TypeSymbol.Equals(previousType, Compilation.GetWellKnownType(WellKnownType.System_Exception), TypeCompareKind.ConsiderEverything2) &&
3404Compilation.SourceAssembly.RuntimeCompatibilityWrapNonExceptionThrows)
3888initializerInvocation = 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));