Binder\Binder_Await.cs (12)
41TypeSymbol awaitExpressionType = (info.GetResult ?? info.RuntimeAsyncAwaitCall?.Method)?.ReturnType ?? (hasErrors ? CreateErrorType() : Compilation.DynamicType);
87var type = expression.Type;
281Debug.Assert(TypeSymbol.Equals(expression.Type, getAwaiterArgument.Type, TypeCompareKind.ConsiderEverything));
317TypeSymbol awaiterType = getAwaiter.Type!;
441var unsubstitutedReturnType = method.ReturnType;
469static bool isValidConversion(TypeSymbol exprType, MethodSymbol method, SyntaxNode node, BindingDiagnosticBag diagnostics, Binder @this, out Conversion conversion)
487bool getRuntimeAwaitAwaiter(TypeSymbol awaiterType, out BoundCall? runtimeAwaitAwaiterCall, out BoundAwaitableValuePlaceholder? placeholder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
630private bool GetIsCompletedProperty(TypeSymbol awaiterType, SyntaxNode node, TypeSymbol awaitedExpressionType, BindingDiagnosticBag diagnostics, [NotNullWhen(true)] out PropertySymbol? isCompletedProperty)
680private bool AwaiterImplementsINotifyCompletion(TypeSymbol awaiterType, SyntaxNode node, BindingDiagnosticBag diagnostics)
704private bool GetGetResultMethod(BoundExpression awaiterExpression, SyntaxNode node, TypeSymbol awaitedExpressionType, BindingDiagnosticBag diagnostics, out MethodSymbol? getResultMethod, [NotNullWhen(true)] out BoundExpression? getAwaiterGetResultCall)
706var awaiterType = awaiterExpression.Type;
Binder\Binder_Conversions.cs (79)
22TypeSymbol destination,
35TypeSymbol destination,
48TypeSymbol destination,
62TypeSymbol destination,
143TypeSymbol destination,
255TypeSymbol? type = source.Type;
360void reportUseSiteDiagnostics(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics)
375void ensureAllUnderlyingConversionsChecked(SyntaxNode syntax, BoundExpression source, Conversion conversion, bool wasCompilerGenerated, TypeSymbol destination, BindingDiagnosticBag diagnostics)
472void checkConstraintLanguageVersionAndRuntimeSupportForConversion(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics)
602TypeSymbol sourceForCastUp = source.Type.IsSpan()
651internal static MethodSymbol? TryFindImplicitOperatorFromArray(TypeSymbol type)
661internal static MethodSymbol? TryFindImplicitOperatorFromSpan(TypeSymbol spanType, TypeSymbol readonlySpanType)
671private static MethodSymbol? TryFindImplicitOperator<TArg>(TypeSymbol type, TArg arg,
684internal static bool NeedsSpanCastUp(TypeSymbol source, TypeSymbol destination)
690var sourceElementType = ((NamedTypeSymbol)source).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
691var destinationElementType = ((NamedTypeSymbol)destination).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
701internal static MethodSymbol? TryFindCastUpMethod(TypeSymbol source, TypeSymbol destination)
729internal static MethodSymbol? TryFindAsSpanCharMethod(CSharpCompilation compilation, TypeSymbol readOnlySpanType)
763private static MethodSymbol? TryFindSingleMethod<TArg>(TypeSymbol type, string name, TArg arg, Func<TArg, MethodSymbol, bool> predicate)
784private BoundExpression BindUnconvertedInterpolatedExpressionToFormattableStringFactory(BoundUnconvertedInterpolatedString unconvertedSource, TypeSymbol destination, BindingDiagnosticBag diagnostics)
806private static void CheckInlineArrayTypeIsSupported(SyntaxNode syntax, TypeSymbol inlineArrayType, TypeSymbol elementType, BindingDiagnosticBag diagnostics)
819SyntaxNode syntax, BoundUnconvertedObjectCreationExpression node, Conversion conversion, bool isCast, TypeSymbol destination,
854TypeSymbol type, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
887TypeSymbol targetType,
905TypeSymbol targetType,
911private readonly TypeSymbol _targetType = targetType;
938var collectionTypeKind = _conversion.GetCollectionExpressionTypeKind(out var elementType, out MethodSymbol? constructor, out bool isExpanded);
969TypeSymbol elementType,
1134ref readonly CollectionExpressionConverter @this, SyntaxNode syntax, TypeSymbol targetType)
1152private readonly ImmutableArray<BoundNode> BindElements(TypeSymbol elementType)
1188ref readonly CollectionExpressionConverter @this, BoundCollectionExpressionSpreadElement element, TypeSymbol elementType, Conversion elementConversion)
1502bool result = namedType.HasCollectionBuilderAttribute(out TypeSymbol? builderType, out string? methodName);
1525TypeSymbol elementTypeOriginalDefinition,
1526TypeSymbol? builderType,
1597var elementType = parameterType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
1655TypeSymbol targetType,
1833internal bool HasCollectionExpressionApplicableAddMethod(SyntaxNode syntax, TypeSymbol targetType, out ImmutableArray<MethodSymbol> addMethods, BindingDiagnosticBag diagnostics)
2090TypeSymbol? receiverType = methodGroup.ReceiverOpt.Type;
2127TypeSymbol secondArgumentType = (constructed ?? member).Parameters[1].Type;
2287internal bool TryGetCollectionIterationType(SyntaxNode syntax, TypeSymbol collectionType, out TypeWithAnnotations iterationType)
2310TypeSymbol targetType,
2356TypeSymbol targetType,
2385var elementType = elementTypeWithAnnotations.Type;
2450TypeSymbol destination,
2491private BoundExpression ConvertSwitchExpression(BoundUnconvertedSwitchExpression source, TypeSymbol destination, Conversion? conversionIfTargetTyped, BindingDiagnosticBag diagnostics, bool hasErrors = false)
2524TypeSymbol destination,
2593TypeSymbol conversionParameterType = conversion.BestUserDefinedConversionAnalysis.Operator.GetParameterType(0);
2597!TypeSymbol.Equals(conversion.BestUserDefinedConversionAnalysis.FromType, conversionParameterType, TypeCompareKind.ConsiderEverything2))
2619TypeSymbol conversionReturnType = conversion.BestUserDefinedConversionAnalysis.Operator.ReturnType;
2620TypeSymbol conversionToType = conversion.BestUserDefinedConversionAnalysis.ToType;
2624!TypeSymbol.Equals(conversionToType, conversionReturnType, TypeCompareKind.ConsiderEverything2))
2640if (conversionToType.IsNullableType() && TypeSymbol.Equals(conversionToType.GetNullableUnderlyingType(), conversionReturnType, TypeCompareKind.ConsiderEverything2))
2713TypeSymbol destination,
2748Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
2749Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
2750Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
2839TypeSymbol destination, BindingDiagnosticBag diagnostics)
2900TypeSymbol destination, BindingDiagnosticBag diagnostics)
2931TypeSymbol destination, BindingDiagnosticBag diagnostics)
2953private static void CheckParameterModifierMismatchMethodConversion(SyntaxNode syntax, MethodSymbol lambdaOrMethod, TypeSymbol targetType, bool invokedAsExtensionMethod, BindingDiagnosticBag diagnostics)
3001private static void CheckLambdaConversion(LambdaSymbol lambdaSymbol, TypeSymbol targetType, BindingDiagnosticBag diagnostics)
3092TypeSymbol destination, BindingDiagnosticBag diagnostics)
3097var elementType = boundStackAlloc.ElementType;
3098TypeSymbol stackAllocType;
3125TypeSymbol destination, BindingDiagnosticBag diagnostics)
3134var destinationWithoutNullable = destination;
3205if (!TypeSymbol.Equals(sourceTuple.Type, destination, TypeCompareKind.ConsiderEverything2))
3516internal bool MethodIsCompatibleWithDelegateOrFunctionPointer(BoundExpression? receiverOpt, bool isExtensionMethod, MethodSymbol method, TypeSymbol delegateType, Location errorLocation, BindingDiagnosticBag diagnostics)
3588var methodReturnType = method.ReturnType;
3589var delegateReturnType = delegateOrFuncPtrMethod.ReturnType;
3635static bool hasConversion(TypeKind targetKind, Conversions conversions, TypeSymbol source, TypeSymbol destination,
3705TypeSymbol delegateOrFuncPtrType,
3802TypeSymbol destination,
3903TypeSymbol destination,
Binder\Binder_Crefs.cs (7)
504TypeSymbol returnType = BindCrefParameterOrReturnType(syntax.Type, syntax, diagnostics);
508symbol.Kind != SymbolKind.Method || TypeSymbol.Equals(((MethodSymbol)symbol).ReturnType, returnType, TypeCompareKind.ConsiderEverything2), returnType);
626if (containerType.Name == memberName && (hasParameterList || containerType.Arity == 0 || !TypeSymbol.Equals(this.ContainingType, containerType.OriginalDefinition, TypeCompareKind.ConsiderEverything2)))
757private static bool ContainsNestedTypeOfUnconstructedGenericType(TypeSymbol type)
1150TypeSymbol type = BindCrefParameterOrReturnType(parameter.Type, (MemberCrefSyntax)parameterListSyntax.Parent, diagnostics);
1161private TypeSymbol BindCrefParameterOrReturnType(TypeSyntax typeSyntax, MemberCrefSyntax memberCrefSyntax, BindingDiagnosticBag diagnostics)
1181TypeSymbol type = parameterOrReturnTypeBinder.BindType(typeSyntax, localDiagnostics).Type;
Binder\Binder_Deconstruct.cs (11)
128var type = boundRHS.Type ?? voidType;
159TypeSymbol returnType = hasErrors ? CreateErrorType() : lhsTuple.Type!;
221TypeSymbol? mergedTupleType = MakeMergedTupleType(checkedVariables, (BoundTupleLiteral)boundRHS, syntax, hadErrors ? null : diagnostics);
244TypeSymbol type,
252ImmutableArray<TypeSymbol> tupleOrDeconstructedTypes;
351private void SetInferredTypes(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<TypeSymbol> foundTypes, BindingDiagnosticBag diagnostics)
369private BoundExpression SetInferredType(BoundExpression expression, TypeSymbol type, BindingDiagnosticBag diagnostics)
473private TypeSymbol? MakeMergedTupleType(ArrayBuilder<DeconstructionVariable> lhsVariables, BoundTupleLiteral rhsLiteral, CSharpSyntaxNode syntax, BindingDiagnosticBag? diagnostics)
483TypeSymbol? mergedType = element.Type;
858var type = declTypeWithAnnotations.Type;
953Debug.Assert(TypeSymbol.Equals(declTypeWithAnnotations.Type, fieldType.Type, TypeCompareKind.ConsiderEverything2));
Binder\Binder_Expressions.cs (126)
223TypeSymbol resultType = expr.Type;
288internal BoundExpression BindToTypeForErrorRecovery(BoundExpression expression, TypeSymbol type = null)
293internal BoundExpression BindToTypeForErrorRecovery(BoundExpression expression, BindingDiagnosticBag diagnostics, TypeSymbol type = null)
321var commonType = expr.Type;
339TypeSymbol type = op.Type;
504TypeSymbol varType,
602TypeSymbol exprType = expr.Type;
885internal virtual BoundSwitchExpressionArm BindSwitchExpressionArm(SwitchExpressionArmSyntax node, TypeSymbol switchGoverningType, BindingDiagnosticBag diagnostics)
1262TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1286TypeSymbol typedReferenceType = GetSpecialType(SpecialType.System_TypedReference, diagnostics, node);
1310TypeSymbol typedReferenceType = this.Compilation.GetSpecialType(SpecialType.System_TypedReference);
1311TypeSymbol typeType = this.GetWellKnownType(WellKnownType.System_Type, diagnostics, node);
1352TypeSymbol runtimeArgumentHandleType = GetSpecialType(SpecialType.System_RuntimeArgumentHandle, diagnostics, node);
1416TypeSymbol type = typeWithAnnotations.Type;
1444var type = typeWithAnnotations.Type;
1469TypeSymbol type = typeWithAnnotations.Type;
1586internal static bool CheckManagedAddr(CSharpCompilation compilation, TypeSymbol type, Location location, BindingDiagnosticBag diagnostics, bool errorForManaged = false)
1601internal static bool CheckManagedAddr(CSharpCompilation compilation, TypeSymbol type, ManagedKind managedKind, Location location, BindingDiagnosticBag diagnostics, bool errorForManaged = false)
1625internal static ConstantValue GetConstantSizeOf(TypeSymbol type)
1636TypeSymbol type = typeWithAnnotations.Type;
2041private bool IsBadLocalOrParameterCapture(Symbol symbol, TypeSymbol type, RefKind refKind)
2075TypeSymbol type = BindResultTypeForLocalVariableReference(node, localSymbol, diagnostics, out isNullableUnknown, out isTypeError);
2190return new BoundTypeExpression(node, null, (TypeSymbol)symbol, hasErrors: isError);
2218TypeSymbol typeSymbol => new BoundTypeExpression(node, alias, typeSymbol, hasErrors: isError),
2233private TypeSymbol BindResultTypeForLocalVariableReference(SimpleNameSyntax node, LocalSymbol localSymbol, BindingDiagnosticBag diagnostics, out bool isNullableUnknown, out bool isError)
2236TypeSymbol type;
2457TypeSymbol hostObjectType = Compilation.GetHostObjectTypeSymbol();
2562var type = symbol as TypeSymbol;
2633TypeSymbol baseType = this.ContainingType is null ? null : this.ContainingType.BaseTypeNoUseSiteDiagnostics;
2665TypeSymbol targetType = targetTypeWithAnnotations.Type;
2671!TypeSymbol.Equals(targetType.GetNullableUnderlyingType(), operand.Type, TypeCompareKind.ConsiderEverything2))
2689TypeSymbol intType = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
2690TypeSymbol indexType = GetWellKnownType(WellKnownType.System_Index, diagnostics, node);
2726TypeSymbol rangeType = GetWellKnownType(WellKnownType.System_Range, diagnostics, node);
2797TypeSymbol indexType = GetWellKnownType(WellKnownType.System_Index, diagnostics, operand);
2827TypeSymbol targetType = targetTypeWithAnnotations.Type;
2848TypeSymbol targetType)
2985var targetElementType = targetElementTypesWithAnnotations[i].Type;
3257var type = declType.Type;
3357TypeSymbol fieldType = expressionVariableField.GetFieldType(this.FieldsBeingBound).Type;
3371internal static void CheckRestrictedTypeInAsyncMethod(Symbol containingSymbol, TypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode syntax)
3744TypeSymbol handlerType,
3865TypeSymbol placeholderType;
4214TypeSymbol bestType = BestTypeInferrer.InferBestType(boundInitializerExpressions, this.Conversions, ref useSiteInfo, out _);
4241TypeSymbol bestType = BestTypeInferrer.InferBestType(boundInitializerExpressions, this.Conversions, ref useSiteInfo, out _);
4369TypeSymbol elemType = type.ElementType;
4607TypeSymbol type = GetStackAllocType(node, elementType, diagnostics, out bool hasErrors);
4690private TypeSymbol GetStackAllocType(SyntaxNode node, TypeWithAnnotations elementTypeWithAnnotations, BindingDiagnosticBag diagnostics, out bool hasErrors)
4762TypeSymbol type,
4763TypeSymbol elementType,
4942TypeSymbol constructorReturnType = constructor.ReturnType;
5067TypeSymbol constructorReturnType,
5301var type = typeWithAnnotations.Type;
5302var originalType = type;
5426var collectionType = enumeratorInfo.CollectionType;
5698private BoundExpression BindClassCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, string typeName, BindingDiagnosticBag diagnostics, TypeSymbol initializerType = null)
5771private BoundExpression MakeBadExpressionForObjectCreation(ObjectCreationExpressionSyntax node, TypeSymbol type, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false)
5777private BoundBadExpression MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, SyntaxNode? typeSyntax, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false)
5797TypeSymbol type,
5828TypeSymbol type,
5850TypeSymbol initializerType,
5999var initializerType = implicitReceiver.Type;
6401TypeSymbol initializerType,
6454private bool CollectionInitializerTypeImplementsIEnumerable(TypeSymbol initializerType, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
6492TypeSymbol initializerType,
6840TypeSymbol initializerTypeOpt = null,
6937TypeSymbol initializerTypeOpt,
7024TypeSymbol initializerTypeOpt,
7078private BoundObjectInitializerExpressionBase MakeBoundInitializerOpt(SyntaxNode typeNode, NamedTypeSymbol type, InitializerExpressionSyntax initializerSyntaxOpt, TypeSymbol initializerTypeOpt, BindingDiagnosticBag diagnostics)
7131Debug.Assert(TypeSymbol.Equals(interfaceType.ComImportCoClass, coClassType, TypeCompareKind.ConsiderEverything2));
7563TypeSymbol type = null;
7663TypeSymbol pointedAtType;
7744TypeSymbol leftType = null;
7778if (TypeSymbol.Equals(boundType.Type, leftType, TypeCompareKind.AllIgnoreOptions))
7803private bool IsPotentialColorColorReceiver(IdentifierNameSyntax id, TypeSymbol type)
7808TypeSymbol.Equals(BindNamespaceOrType(id, BindingDiagnosticBag.Discarded).Type, type, TypeCompareKind.AllIgnoreOptions);
7918TypeSymbol leftType = boundLeft.Type;
8134TypeSymbol leftType,
8327var leftType = boundLeft.Type;
8410private void LookupInstanceMember(LookupResult lookupResult, TypeSymbol leftType, bool leftIsBaseReference, string rightName, int rightArity, bool invoked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
8488private bool WouldUsingSystemFindExtension(TypeSymbol receiver, string methodName)
8500private bool ImplementsWinRTAsyncInterface(TypeSymbol type)
8505private bool IsWinRTAsyncInterface(TypeSymbol type)
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);
8576private TypeSymbol GetNonMethodMemberType(Symbol symbolOpt)
8578TypeSymbol resultType = null;
8768TypeSymbol? returnType,
8850TypeSymbol? returnType,
9037TypeSymbol? returnType,
9059TypeSymbol? receiverType = left.Type;
9149if (arguments.Arguments is not [{ Type: TypeSymbol argType }])
9167internal static bool IsWellKnownSystemIndex(TypeSymbol? type, CSharpCompilation compilation)
9169return TypeSymbol.Equals(type, compilation.GetWellKnownType(WellKnownType.System_Index), TypeCompareKind.AllIgnoreOptions);
9172internal static bool IsWellKnownSystemRange(TypeSymbol? type, CSharpCompilation compilation)
9174return TypeSymbol.Equals(type, compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.AllIgnoreOptions);
9837TypeSymbol receiverType = receiver.Type;
9906TypeSymbol fieldType = fieldSymbol.GetFieldType(this.FieldsBeingBound).Type;
9930private TypeSymbol GetAdjustedTypeForEnumMemberReference(FieldSymbol fieldSymbol, TypeSymbol fieldType)
10013Debug.Assert(symbol is not TypeSymbol);
10061return !symbol.IsStatic && !(symbol is TypeSymbol) &&
10361if (!TypeSymbol.IsInlineArrayElementFieldSupported(elementField))
10386{ Code: (int)ErrorCode.ERR_BadIndexLHS, Arguments: [TypeSymbol type] } && type.Equals(expr.Type, TypeCompareKind.ConsiderEverything))
10523TypeSymbol resultType;
10615var exprType = expr.Type;
10696TypeSymbol resultType = indexOrRangeWellknownType == WellKnownType.System_Range
10792TypeSymbol type = GetWellKnownType(wellKnownType, ref useSiteInfo);
10814TypeSymbol type = GetSpecialType(specialType, attemptDiagnostics, node);
10827private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, TypeSymbol targetType, SyntaxNode node, BindingDiagnosticBag diagnostics)
10871TypeSymbol pointedAtType = pointerType.PointedAtType;
11517TypeSymbol receiverType,
11536TypeSymbol receiverType,
11574TypeSymbol propertyType = GetCommonTypeOrReturnType(propertyGroup) ?? CreateErrorType();
11601TypeSymbol returnType = null,
11625TypeSymbol returnType = null,
11657TypeSymbol returnType = null,
11728TypeSymbol returnType = null,
12299internal static bool ReportDelegateInvokeUseSiteDiagnostic(BindingDiagnosticBag diagnostics, TypeSymbol possibleDelegateType,
12355var receiverType = receiver.Type;
12364var accessType = access.Type;
12503var receiverType = receiver.Type;
12534var receiverType = receiver.Type;
Binder\Binder_InterpolatedString.cs (6)
336TypeSymbol destination,
519Func<BoundUnconvertedInterpolatedString, int, (ImmutableArray<ImmutableArray<BoundExpression>>, TypeSymbol), BoundExpression> interpolationFactory =
521Func<BoundBinaryOperator, BoundExpression, BoundExpression, (ImmutableArray<ImmutableArray<BoundExpression>>, TypeSymbol), BoundExpression> binaryOperatorFactory =
528static BoundInterpolatedString createInterpolation(BoundUnconvertedInterpolatedString expression, int i, (ImmutableArray<ImmutableArray<BoundExpression>> AppendCalls, TypeSymbol _) arg)
540static BoundBinaryOperator createBinaryOperator(BoundBinaryOperator original, BoundExpression left, BoundExpression right, (ImmutableArray<ImmutableArray<BoundExpression>> _, TypeSymbol @string) arg)
674TypeSymbol objectType = GetSpecialType(SpecialType.System_Object, diagnostics, syntax);
Binder\Binder_Invocation.cs (23)
276TypeSymbol objType = GetSpecialType(SpecialType.System_Object, diagnostics, node);
1115if (call.ReceiverOpt.Type.IsRestrictedType() && !call.Method.ContainingType.IsInterface && !TypeSymbol.Equals(call.Method.ContainingType, call.ReceiverOpt.Type, TypeCompareKind.ConsiderEverything2))
1235var returnType = methodResult.Member.ReturnType;
1455var parameterType = parameter.Type;
1692TypeSymbol parameterType = parameter.Type;
1761TypeSymbol constantType = Compilation.GetSpecialType(defaultConstantValue.SpecialType);
1863TypeSymbol collectionType = paramsParameter.Type;
1868TypeSymbol int32Type = GetSpecialType(SpecialType.System_Int32, diagnostics, node);
1941TypeSymbol.Equals(containingMethod.ContainingType, method.ContainingType, TypeCompareKind.ConsiderEverything) &&
2109var returnType = GetCommonTypeOrReturnType(methods) ?? new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2110var methodContainer = (object)receiver != null && (object)receiver.Type != null
2215var parameterType = GetCorrespondingParameterType(analyzedArguments, i, parameterList);
2239var candidateType = getCorrespondingParameterType(i);
2286TypeSymbol getCorrespondingParameterType(int i)
2289TypeSymbol candidateType = null;
2292var parameterType = GetCorrespondingParameterType(analyzedArguments, i, parameterList);
2320private static TypeSymbol GetCorrespondingParameterType(AnalyzedArguments analyzedArguments, int i, ImmutableArray<ParameterSymbol> parameterList)
2352TypeSymbol returnType = new ExtendedErrorTypeSymbol(this.Compilation, string.Empty, arity: 0, errorInfo: null);
2353var methodContainer = expr.Type ?? this.ContainingType;
2364private static TypeSymbol GetCommonTypeOrReturnType<TMember>(ImmutableArray<TMember> members)
2367TypeSymbol type = null;
2370TypeSymbol returnType = members[i].GetTypeOrReturnType().Type;
2375else if (!TypeSymbol.Equals(type, returnType, TypeCompareKind.ConsiderEverything2))
Binder\Binder_Lookup.cs (80)
32ConsList<TypeSymbol> basesBeingResolved,
67private Binder LookupSymbolsWithFallback(LookupResult result, string name, int arity, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null, LookupOptions options = LookupOptions.Default)
88LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
122LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
136ConsList<TypeSymbol> basesBeingResolved,
154private void LookupMembersWithFallback(LookupResult result, NamespaceOrTypeSymbol nsOrType, string name, int arity, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null, LookupOptions options = LookupOptions.Default)
170protected void LookupMembersInternal(LookupResult result, NamespaceOrTypeSymbol nsOrType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
181this.LookupMembersInType(result, (TypeSymbol)nsOrType, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteInfo);
280protected void LookupMembersInType(LookupResult result, TypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
321private void LookupMembersInErrorType(LookupResult result, ErrorTypeSymbol errorType, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
330TypeSymbol candidateType = errorType.CandidateSymbols.First() as TypeSymbol;
356protected void LookupMembersInSubmissions(LookupResult result, TypeSymbol submissionClass, CompilationUnitSyntax declarationSyntax, bool inUsings, string name, int arity, ConsList<TypeSymbol> basesBeingResolved,
505ConsList<TypeSymbol> basesBeingResolved,
572ConsList<TypeSymbol> basesBeingResolved,
865protected static void LookupMembersWithoutInheritance(LookupResult result, TypeSymbol type, string name, int arity,
866LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
882TypeSymbol type,
885ConsList<TypeSymbol> basesBeingResolved,
897TypeSymbol type,
900ConsList<TypeSymbol> basesBeingResolved,
903TypeSymbol accessThroughType,
910TypeSymbol currentType = type;
1078TypeSymbol.Equals(iFaceOriginal, idictSymbol, TypeCompareKind.ConsiderEverything2) ||
1081TypeSymbol.Equals(iFaceOriginal, iroDictSymbol, TypeCompareKind.ConsiderEverything2) ||
1083TypeSymbol.Equals(iFaceOriginal, iListSymbol, TypeCompareKind.ConsiderEverything2) ||
1084TypeSymbol.Equals(iFaceOriginal, iCollectionSymbol, TypeCompareKind.ConsiderEverything2) ||
1085TypeSymbol.Equals(iFaceOriginal, inccSymbol, TypeCompareKind.ConsiderEverything2) ||
1086TypeSymbol.Equals(iFaceOriginal, inpcSymbol, TypeCompareKind.ConsiderEverything2);
1090private static Symbol GetNearestOtherSymbol(ConsList<TypeSymbol> list, TypeSymbol type)
1092TypeSymbol other = type;
1094for (; list != null && list != ConsList<TypeSymbol>.Empty; list = list.Tail)
1096if (TypeSymbol.Equals(list.Head, type.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
1098if (TypeSymbol.Equals(other, type, TypeCompareKind.ConsiderEverything2) && list.Tail != null && list.Tail != ConsList<TypeSymbol>.Empty)
1119ConsList<TypeSymbol> basesBeingResolved,
1122TypeSymbol accessThroughType,
1131((options & LookupOptions.NamespacesOrTypesOnly) == 0 || !(current.IsSingleViable && TypeSymbol.Equals(current.SingleSymbolOrDefault.ContainingType, type, TypeCompareKind.AllIgnoreOptions)))) // The nested type will shadow everything from bases
1138private static ImmutableArray<NamedTypeSymbol> GetBaseInterfaces(NamedTypeSymbol type, ConsList<TypeSymbol> basesBeingResolved, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1191static void addAllInterfaces(NamedTypeSymbol @interface, HashSet<NamedTypeSymbol> visited, ArrayBuilder<NamedTypeSymbol> result, ConsList<TypeSymbol> basesBeingResolved, ConsList<NamedTypeSymbol> cycleGuard)
1222ConsList<TypeSymbol> basesBeingResolved,
1225TypeSymbol accessThroughType,
1252private void LookupMembersInInterface(LookupResult current, NamedTypeSymbol type, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1270private void LookupMembersInTypeParameter(LookupResult current, TypeParameterSymbol typeParameter, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1289private static bool IsDerivedType(NamedTypeSymbol baseType, NamedTypeSymbol derivedType, ConsList<TypeSymbol> basesBeingResolved, CSharpCompilation compilation, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1291Debug.Assert(!TypeSymbol.Equals(baseType, derivedType, TypeCompareKind.ConsiderEverything2));
1297if (TypeSymbol.Equals(b, baseType, TypeCompareKind.ConsiderEverything2)) return true;
1310if (TypeSymbol.Equals(b, baseType, TypeCompareKind.ConsiderEverything2))
1326private void MergeHidingLookupResults(LookupResult resultHiding, LookupResult resultHidden, ConsList<TypeSymbol> basesBeingResolved, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1397if ((options & LookupOptions.NamespacesOrTypesOnly) != 0 && nsOrType is TypeSymbol)
1421if ((options & LookupOptions.NamespacesOrTypesOnly) != 0 && nsOrType is TypeSymbol)
1487internal SingleLookupResult CheckViability(Symbol symbol, int arity, LookupOptions options, TypeSymbol accessThroughType, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null)
1518(unwrappedSymbol is not TypeSymbol && IsInstance(unwrappedSymbol) || !(unwrappedSymbol.IsAbstract || unwrappedSymbol.IsVirtual)))
1685internal bool CanAddLookupSymbolInfo(Symbol symbol, LookupOptions options, LookupSymbolsInfo info, TypeSymbol accessThroughType, AliasSymbol aliasSymbol = null)
1737private static TypeSymbol RefineAccessThroughType(LookupOptions options, TypeSymbol accessThroughType)
1773internal bool IsAccessible(Symbol symbol, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, TypeSymbol accessThroughType = null, ConsList<TypeSymbol> basesBeingResolved = null)
1792internal bool IsAccessible(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null)
1804/// Should only be called by <see cref="IsAccessible(Symbol, TypeSymbol, out bool, ref CompoundUseSiteInfo{AssemblySymbol}, ConsList{TypeSymbol})"/>,
1807internal virtual bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
1834TypeSymbol type = null;
1965this.AddMemberLookupSymbolsInfoInType(result, (TypeSymbol)nsOrType, options, originalBinder);
1969private void AddMemberLookupSymbolsInfoInType(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder)
1993protected void AddMemberLookupSymbolsInfoInSubmissions(LookupSymbolsInfo result, TypeSymbol scriptClass, bool inUsings, LookupOptions options, Binder originalBinder)
2066private static void AddMemberLookupSymbolsInfoWithoutInheritance(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2078private void AddWinRTMembersLookupSymbolsInfo(LookupSymbolsInfo result, NamedTypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2093private void AddMemberLookupSymbolsInfoInClass(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
2124private void AddMemberLookupSymbolsInfoInInterface(LookupSymbolsInfo result, TypeSymbol type, LookupOptions options, Binder originalBinder, TypeSymbol accessThroughType)
Binder\Binder_Operators.cs (73)
267var leftType = left.Type;
340var leftType = left.Type;
383var leftType = left.Type;
434var leftType = left.Type;
561TypeSymbol getResultType(ExpressionSyntax node, TypeSymbol leftType, BindingDiagnosticBag diagnostics)
699TypeSymbol delegateType = left.Type;
718TypeSymbol type;
780TypeSymbol type = operand.Type;
952TypeSymbol leftType = left.Type;
953TypeSymbol rightType = right.Type;
1066TypeSymbol resultType = signature.ReturnType;
1191TypeSymbol leftType = left.Type;
1192TypeSymbol rightType = right.Type;
1378bool isReadOnlySpanOfByte(TypeSymbol? type)
1592var type = left.Type;
1649TypeSymbol parameterType = userDefinedOperator.Parameters[0].Type;
1763bool typesAreSame = TypeSymbol.Equals(signature.LeftType, signature.RightType, TypeCompareKind.ConsiderEverything2) && TypeSymbol.Equals(signature.LeftType, signature.ReturnType, TypeCompareKind.ConsiderEverything2);
1765bool typeMatchesContainer = TypeSymbol.Equals(signature.ReturnType.StrippedType(), t, TypeCompareKind.ConsiderEverything2) ||
1921if (!TypeSymbol.Equals(signature.LeftType, signature.RightType, TypeCompareKind.AllIgnoreOptions) ||
1922!TypeSymbol.Equals(signature.LeftType, signature.ReturnType, TypeCompareKind.AllIgnoreOptions))
2012private TypeSymbol GetBinaryOperatorErrorType(BinaryOperatorKind kind, BindingDiagnosticBag diagnostics, CSharpSyntaxNode node)
2389static bool isNuint(TypeSymbol type)
2631internal static TypeSymbol GetEnumType(BinaryOperatorKind kind, BoundExpression left, BoundExpression right)
2683TypeSymbol resultTypeSymbol,
2696TypeSymbol enumType = GetEnumType(kind, left, right);
2697TypeSymbol underlyingType = enumType.GetEnumUnderlyingType()!;
2707TypeSymbol operandType = (operandSpecialType == underlyingType.SpecialType) ?
2743TypeSymbol resultType = kind == BinaryOperatorKind.EnumSubtraction ? underlyingType : enumType;
2758TypeSymbol resultTypeSymbol,
3297var operandType = operand.Type;
3451var operandType = operand.Type;
3541var operandType = operand.Type;
3669TypeSymbol getResultType(ExpressionSyntax node, TypeSymbol operandType, InstanceUserDefinedIncrementUsageMode mode, BindingDiagnosticBag diagnostics)
3793private ArrayBuilder<MethodSymbol>? LookupUserDefinedInstanceOperators(TypeSymbol lookupInType, string? checkedName, string ordinaryName, int parameterCount, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3992private bool CheckConstraintLanguageVersionAndRuntimeSupportForOperator(SyntaxNode node, MethodSymbol? methodOpt, bool isUnsignedRightShift, TypeSymbol? constrainedToTypeOpt, BindingDiagnosticBag diagnostics)
4083TypeSymbol pointedAtType;
4097private static void BindPointerIndirectionExpressionInternal(CSharpSyntaxNode node, BoundExpression operand, BindingDiagnosticBag diagnostics, out TypeSymbol pointedAtType, out bool hasErrors)
4154TypeSymbol operandType = operand.Type;
4176TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(operandType));
4417var resultType = signature.ReturnType;
4474TypeSymbol resultTypeSymbol,
4794private bool IsOperatorErrors(CSharpSyntaxNode node, TypeSymbol operandType, BoundTypeExpression typeExpression, BindingDiagnosticBag diagnostics)
4796var targetType = typeExpression.Type;
4823var resultType = (TypeSymbol)GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
4827TypeSymbol inputType = operand.Type;
4899var targetType = typeExpression.Type;
4996TypeSymbol targetType = targetTypeWithAnnotations.Type;
5006TypeSymbol operandType,
5007TypeSymbol targetType,
5041TypeSymbol operandType,
5042TypeSymbol targetType,
5349TypeSymbol targetType = targetTypeWithAnnotations.Type;
5352var resultType = targetType;
5453var operandType = operand.Type;
5504TypeSymbol operandType,
5505TypeSymbol targetType,
5566TypeSymbol operandType,
5567TypeSymbol targetType,
5597internal static ConstantValue GetAsOperatorConstantResult(TypeSymbol operandType, TypeSymbol targetType, ConversionKind conversionKind, ConstantValue operandConstantValue)
5665TypeSymbol optLeftType = leftOperand.Type; // "A"
5666TypeSymbol optRightType = rightOperand.Type; // "B"
5668TypeSymbol optLeftType0 = isLeftNullable ? // "A0"
5839TypeSymbol leftType = leftOperand.Type;
5855var underlyingLeftType = leftType.GetNullableUnderlyingType();
5958TypeSymbol? bestType = BestTypeInferrer.InferBestTypeForConditionalOperator(trueExpr, falseExpr, this.Conversions, out bool hadMultipleCandidates, ref useSiteInfo);
5998TypeSymbol trueType = trueExpr.Type;
5999TypeSymbol falseType = falseExpr.Type;
6001TypeSymbol type;
Binder\Binder_Patterns.cs (88)
19protected NamedTypeSymbol? PrepareForUnionMatchingIfAppropriateAndReturnUnionMatchingInputType(SyntaxNode node, ref TypeSymbol inputType, ref NamedTypeSymbol? unionType, BindingDiagnosticBag diagnostics)
234internal static MethodSymbol? GetUnionTypeTryGetValueMethod(ConversionsBase conversions, NamedTypeSymbol inputUnionType, TypeSymbol type)
241PooledHashSet<TypeSymbol>? typeSet = null;
308TypeSymbol type,
311ref PooledHashSet<TypeSymbol>? typeSet,
341typeSet = TypeSymbol.AllIgnoreOptionsSetPool.Allocate();
343foreach (var caseType in inputUnionType.OriginalDefinition.UnionCaseTypes(ref discardedUseSiteInfo))
429ImmutableArray<TypeSymbol> unionDefinitionCaseTypes = unionDefinition.UnionCaseTypesNoUseSiteDiagnostics;
462ImmutableArray<TypeSymbol> unionDefinitionCaseTypes = unionDefinition.UnionCaseTypesNoUseSiteDiagnostics;
504static bool isMatch(MethodSymbol method, ImmutableArray<TypeSymbol> unionDefinitionCaseTypes)
538TypeSymbol? expressionType = expression.Type;
565TypeSymbol boolType,
694TypeSymbol inputType,
723TypeSymbol inputType,
736TypeSymbol inputType,
761TypeSymbol sliceType;
799TypeSymbol inputType,
800TypeSymbol elementType,
835TypeSymbol inputType,
846TypeSymbol elementType;
849TypeSymbol narrowedType = inputType.StrippedType();
897private bool IsCountableAndIndexable(SyntaxNode node, TypeSymbol inputType, out PropertySymbol? lengthProperty)
905private bool BindLengthAndIndexerForListPattern(SyntaxNode node, TypeSymbol inputType, BindingDiagnosticBag diagnostics,
950private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics)
959TypeSymbol inputType,
971TypeSymbol inputType,
984var convertedType = convertedExpression.Type ?? inputType;
1035private bool ShouldBlockINumberBaseConversion(Conversion patternConversion, TypeSymbol inputType)
1081TypeSymbol inputType,
1111TypeSymbol inputType,
1131TypeSymbol inputType,
1147var strippedInputType = inputType.StrippedType();
1176TypeSymbol inputType,
1309foreach (var caseType in unionType.UnionCaseTypes(ref useSiteInfo))
1360TypeSymbol inputType,
1361TypeSymbol patternType,
1431bool reportBadMatch(SyntaxNode typeSyntax, TypeSymbol inputType, TypeSymbol patternType, ConstantValue matchPossible, Conversion conversion, BindingDiagnosticBag diagnostics)
1462TypeSymbol patternType,
1471foreach (var caseType in unionType.UnionCaseTypes(ref useSiteInfo))
1496TypeSymbol expressionType,
1497TypeSymbol patternType,
1531TypeSymbol inputType,
1551TypeSymbol inputType,
1627TypeSymbol inputType,
1648internal static bool IsZeroElementTupleType(TypeSymbol type)
1658TypeSymbol inputType,
1679TypeSymbol declType = declTypeWithAnnotations.Type;
1779TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type;
1855TypeSymbol declType,
1874TypeSymbol elementType = isError ? CreateErrorType() : elementTypesWithAnnotations[i].Type;
1901TypeSymbol declType,
1939TypeSymbol declType,
1992bool hasBaseInterface(TypeSymbol type, NamedTypeSymbol possibleBaseInterface)
2027TypeSymbol inputType,
2055TypeSymbol inputType,
2095BoundPattern bindParenthesizedVariableDesignation(VariableDesignationSyntax node, ref NamedTypeSymbol? unionType, TypeSymbol inputType, bool permitDesignations, bool hasErrors, BindingDiagnosticBag diagnostics, out bool hasUnionMatching)
2106var strippedInputType = inputType.StrippedType();
2152TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type;
2177TypeSymbol elementType = isError ? CreateErrorType() : elementTypes[i].Type;
2211TypeSymbol inputType,
2227TypeSymbol memberType;
2248TypeSymbol receiverType = member.Receiver?.Type ?? inputType;
2275TypeSymbol inputType, ExpressionSyntax expr, BindingDiagnosticBag diagnostics, ref bool hasErrors, out NamedTypeSymbol? unionType)
2296TypeSymbol memberType;
2324TypeSymbol inputType,
2397TypeSymbol inputType,
2415TypeSymbol inputType,
2427var type = value.Type ?? inputType;
2489internal static BinaryOperatorKind RelationalOperatorType(TypeSymbol type) => type.SpecialType switch
2513TypeSymbol inputType,
2530TypeSymbol inputType,
2553var narrowedTypeCandidates = ArrayBuilder<TypeSymbol>.GetInstance(2);
2584TypeSymbol inputType,
2585ArrayBuilder<TypeSymbol> narrowedTypeCandidates,
2607var narrowedType = LeastSpecificType(narrowedTypeCandidates, binder.Conversions, ref useSiteInfo) ?? inputType;
2627internal static TypeSymbol? LeastSpecificType(ArrayBuilder<TypeSymbol> candidates, Conversions conversions, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2630TypeSymbol? bestSoFar = candidates[0];
2634TypeSymbol candidate = candidates[i];
2640TypeSymbol candidate = candidates[i];
2641TypeSymbol? spoiler = lessSpecificCandidate(candidate, bestSoFar, conversions, ref useSiteInfo);
2655static TypeSymbol? lessSpecificCandidate(TypeSymbol bestSoFar, TypeSymbol possiblyLessSpecificCandidate, Conversions conversions, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2680internal static void CollectDisjunctionTypes(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates, bool hasUnionMatching)
2688var candidate = pat.NarrowedType;
2703static void adjustForUnionMatching(BoundPattern pat, ref TypeSymbol candidate)
Binder\Binder_QueryErrors.cs (16)
80private bool ImplementsStandardQueryInterface(TypeSymbol instanceType, string name, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
88var originalType = instanceType.OriginalDefinition;
91bool isIenumerable = TypeSymbol.Equals(originalType, ienumerable_t, TypeCompareKind.ConsiderEverything2) || HasUniqueInterface(instanceType, ienumerable_t, ref nonUnique, ref useSiteInfo);
92bool isQueryable = TypeSymbol.Equals(originalType, iqueryable_t, TypeCompareKind.ConsiderEverything2) || HasUniqueInterface(instanceType, iqueryable_t, ref nonUnique, ref useSiteInfo);
96private static bool HasUniqueInterface(TypeSymbol instanceType, NamedTypeSymbol interfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
102private static bool HasUniqueInterface(TypeSymbol instanceType, NamedTypeSymbol interfaceType, ref bool nonUnique, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
104TypeSymbol candidate = null;
107if (TypeSymbol.Equals(i.OriginalDefinition, interfaceType, TypeCompareKind.ConsiderEverything2))
113else if (!TypeSymbol.Equals(candidate, i, TypeCompareKind.ConsiderEverything2))
124private bool HasCastToQueryProvider(TypeSymbol instanceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
126var originalType = instanceType.OriginalDefinition;
129bool isIenumerable = TypeSymbol.Equals(originalType, ienumerable, TypeCompareKind.ConsiderEverything2) || HasUniqueInterface(instanceType, ienumerable, ref useSiteInfo);
130bool isQueryable = TypeSymbol.Equals(originalType, iqueryable, TypeCompareKind.ConsiderEverything2) || HasUniqueInterface(instanceType, iqueryable, ref useSiteInfo);
219TypeSymbol type = null;
223foreach (var t in unbound.Data.InferredReturnTypes())
238TypeSymbol receiverType = receiver?.Type;
Binder\Binder_Statements.cs (37)
237TypeSymbol elementType = GetIteratorElementType().Type;
407var type = boundExpr.Type;
1027TypeSymbol initializerType = initializerOpt?.Type;
1227private bool IsValidFixedVariableInitializer(TypeSymbol declType, ref BoundExpression initializerOpt, BindingDiagnosticBag diagnostics)
1237TypeSymbol initializerType = initializerOpt.Type;
1246TypeSymbol elementType;
1360TypeSymbol elementType,
1361TypeSymbol declType,
1370TypeSymbol pointerType = new PointerTypeSymbol(TypeWithAnnotations.Create(elementType));
1465var inferredType = op2.Type;
1530TypeSymbol type;
1816TypeSymbol.Equals(sourceProperty.ContainingType, fromMember.ContainingType, TypeCompareKind.AllIgnoreOptions) &&
1847private TypeSymbol GetAccessThroughType(BoundExpression receiver)
1868TypeSymbol destinationType,
1963internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None)
1966internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, out Conversion conversion, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None)
2046UnboundLambda anonymousFunction, TypeSymbol targetType)
2238var lambdaParameterType = anonymousFunction.ParameterType(i);
2245var delegateParameterType = delegateParameters[i].Type;
2279Conversion conversion, TypeSymbol sourceType, TypeSymbol targetType, ConstantValue sourceConstantValueOpt = null)
2330else if (TypeSymbol.Equals(sourceType, targetType, TypeCompareKind.ConsiderEverything2))
2351TypeSymbol targetType)
2480var sourceType = operand.Type;
2569var targetElementType = targetElementTypes[i].Type;
3016protected virtual TypeSymbol GetCurrentReturnType(out RefKind refKind)
3023TypeSymbol returnType = symbol.ReturnType;
3058TypeSymbol retType = GetCurrentReturnType(out sigRefKind);
3150var requiredType = IsEffectivelyGenericTaskReturningAsyncMethod()
3181TypeSymbol returnType)
3231&& TypeSymbol.Equals(argument.Type, this.GetCurrentReturnType(out unusedRefKind), TypeCompareKind.ConsiderEverything2))
3306TypeSymbol type = null;
3325TypeSymbol effectiveType = type.EffectiveType(ref useSiteInfo);
3355var previousType = previousBlock.ExceptionTypeOpt;
3379else if (TypeSymbol.Equals(previousType, Compilation.GetWellKnownType(WellKnownType.System_Exception), TypeCompareKind.ConsiderEverything2) &&
3402Debug.Assert(local.Type.IsErrorType() || (TypeSymbol.Equals(local.Type, type, TypeCompareKind.ConsiderEverything2)));
3517var returnType = GetCurrentReturnType(out returnRefKind);
Binder\Binder_Symbols.cs (33)
187/// Otherwise, call <see cref="Binder.BindTypeOrAlias(ExpressionSyntax, BindingDiagnosticBag, ConsList{TypeSymbol}, bool)"/> instead.
262var type = UnwrapAlias(symbol, diagnostics, syntax) as TypeSymbol;
305internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null, bool suppressUseSiteDiagnostics = false)
314internal TypeWithAnnotations BindType(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, out AliasSymbol alias, ConsList<TypeSymbol> basesBeingResolved = null)
323internal NamespaceOrTypeOrAliasSymbolWithAnnotations BindTypeOrAlias(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null, bool suppressUseSiteDiagnostics = false)
331(symbol.IsAlias && UnwrapAliasNoDiagnostics(symbol.Symbol, basesBeingResolved) is TypeSymbol))
387internal NamespaceOrTypeOrAliasSymbolWithAnnotations BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null)
397internal NamespaceOrTypeOrAliasSymbolWithAnnotations BindNamespaceOrTypeSymbol(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved, bool suppressUseSiteDiagnostics)
411/// <see cref="BindQualifiedName(ExpressionSyntax, SimpleNameSyntax, BindingDiagnosticBag, ConsList{TypeSymbol}, bool)"/>
420internal NamespaceOrTypeOrAliasSymbolWithAnnotations BindNamespaceOrTypeOrAliasSymbol(ExpressionSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved, bool suppressUseSiteDiagnostics)
643ConsList<TypeSymbol> basesBeingResolved,
688private TypeSymbol BindTupleType(TupleTypeSyntax syntax, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved)
832ConsList<TypeSymbol> basesBeingResolved,
859ConsList<TypeSymbol> basesBeingResolved,
923if (aliasTarget is TypeSymbol type)
1096private static Symbol UnwrapAliasNoDiagnostics(Symbol symbol, ConsList<TypeSymbol> basesBeingResolved = null)
1106private NamespaceOrTypeOrAliasSymbolWithAnnotations UnwrapAlias(in NamespaceOrTypeOrAliasSymbolWithAnnotations symbol, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null)
1117private NamespaceOrTypeOrAliasSymbolWithAnnotations UnwrapAlias(in NamespaceOrTypeOrAliasSymbolWithAnnotations symbol, out AliasSymbol alias, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null)
1128private Symbol UnwrapAlias(Symbol symbol, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null)
1134private Symbol UnwrapAlias(Symbol symbol, out AliasSymbol alias, BindingDiagnosticBag diagnostics, SyntaxNode syntax, ConsList<TypeSymbol> basesBeingResolved = null)
1143var type = result as TypeSymbol;
1166ConsList<TypeSymbol> basesBeingResolved,
1274ConsList<TypeSymbol> basesBeingResolved,
1360private ImmutableArray<TypeWithAnnotations> BindTypeArguments(SeparatedSyntaxList<TypeSyntax> typeArguments, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null)
1372private TypeWithAnnotations BindTypeArgument(TypeSyntax typeArgument, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved = null)
1557ArrayBuilder<Symbol> members, TypeSymbol receiverType,
1636ConsList<TypeSymbol> basesBeingResolved,
1668ConsList<TypeSymbol> basesBeingResolved,
2334var singleType = singleResult as TypeSymbol;
Binder\Binder_TupleOperators.cs (15)
33TypeSymbol resultType = GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
40TypeSymbol convertedType = isRight ? @operator.RightConvertedTypeOpt : @operator.LeftConvertedTypeOpt;
85TypeSymbol leftType = left.Type;
86TypeSymbol rightType = right.Type;
126private void PrepareBoolConversionAndTruthOperator(TypeSymbol type, BinaryExpressionSyntax node, BinaryOperatorKind binaryOperator, BindingDiagnosticBag diagnostics,
132TypeSymbol boolean = GetSpecialType(SpecialType.System_Boolean, diagnostics, node);
198TypeSymbol dynamicType = hasError ? CreateErrorType() : Compilation.DynamicType;
258TypeSymbol leftTupleType = MakeConvertedType(operators.SelectAsArray(o => o.LeftConvertedTypeOpt), node.Left, leftParts, leftNames, isNullable, compilation, diagnostics);
259TypeSymbol rightTupleType = MakeConvertedType(operators.SelectAsArray(o => o.RightConvertedTypeOpt), node.Right, rightParts, rightNames, isNullable, compilation, diagnostics);
331internal static BoundExpression GiveTupleTypeToDefaultLiteralIfNeeded(BoundExpression expr, TypeSymbol targetType)
362TypeSymbol type = expr.Type;
389TypeSymbol tupleType = expr.Type.StrippedType();
401private TypeSymbol MakeConvertedType(ImmutableArray<TypeSymbol> convertedTypes, CSharpSyntaxNode syntax,
405foreach (var convertedType in convertedTypes)
Binder\DecisionDagBuilder.cs (26)
350public TypeSymbol GetInputType() => UnionValue?.Type ?? DagTemp.Type;
549bool isDerivedType(TypeSymbol possibleDerived, TypeSymbol possibleBase)
583TypeSymbol? type = declaration.DeclaredType?.Type;
611TypeSymbol type = typePattern.DeclaredType.Type;
632private static bool IsUnionTryGetValueReturn(BoundDagTemp input, [NotNullWhen(true)] out TypeSymbol? targetType, [NotNullWhen(true)] out BoundDagTemp? unionInstance, [NotNullWhen(true)] out BoundDagDeconstructEvaluation? tryGetValueEvaluation)
657internal static bool IsUnionTryGetValueEvaluation([NotNullWhen(true)] BoundDagEvaluation? evaluation, [NotNullWhen(true)] out TypeSymbol? targetType, [NotNullWhen(true)] out BoundDagTemp? unionInstance)
774TypeSymbol type,
833TypeSymbol inputType = input.Type.StrippedType(); // since a null check has already been done
930TypeSymbol inputTempType = inputInfo.GetInputType();
932var inputType = recursive.DeclaredType?.Type ?? inputTempType.StrippedType();
1176var type = rel.Value.Type ?? inputInfo.GetInputType();
1196private TypeSymbol ErrorType(string name = "")
2124TypeSymbol t1Type,
2125TypeSymbol t2Type)
2195TypeSymbol? testTargetType;
2207TypeSymbol? otherTargetType;
2303static UnionTestKind getUnionTestKind(BoundDagTest test, out TypeSymbol? targetType, out BoundDagTemp? testUnionInstance)
2353static bool isAnyUnionValueTypeTest(BoundDagTest test, [NotNullWhen(true)] out TypeSymbol? targetType, [NotNullWhen(true)] out BoundDagTemp? testUnionInstance)
2384private static bool IsUnionTryGetValueTest(BoundDagTest test, [NotNullWhen(true)] out TypeSymbol? targetType, [NotNullWhen(true)] out BoundDagTemp? testUnionInstance, [NotNullWhen(true)] out BoundDagDeconstructEvaluation? tryGetValueEvaluation)
2696TypeSymbol expressionType,
2697TypeSymbol patternType,
2705static bool isRuntimeSimilar(TypeSymbol expressionType, TypeSymbol patternType)
2712TypeSymbol e1 = array1.ElementType.EnumUnderlyingTypeOrSelf();
2713TypeSymbol e2 = array2.ElementType.EnumUnderlyingTypeOrSelf();
Binder\ForEachLoopBinder.cs (28)
541TypeSymbol getEnumeratorType = getEnumeratorMethod.ReturnType;
615var awaitableType = builder.PatternDisposeInfo is null
643TypeSymbol collectionType,
723TypeSymbol collectionExprType = collectionExpr.Type;
800TypeSymbol collectionExprType = collectionExpr.Type;
868if (!TypeSymbol.IsInlineArrayElementFieldSupported(elementField))
942TypeSymbol collectionExprType = collectionExpr.Type;
982var unwrappedCollectionExprType = unwrappedCollectionExpr.Type;
1070private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType)
1130TypeSymbol enumeratorType = specificGetEnumeratorMethod.ReturnType;
1204TypeSymbol enumeratorType = builder.GetEnumeratorInfo.Method.ReturnType;
1274bool implementsInterface(TypeSymbol collectionType, TypeSymbol enumeratorType, bool isAsync, BindingDiagnosticBag diagnostics)
1298private ForEachEnumeratorInfo.Builder GetDefaultEnumeratorInfo(SyntaxNode syntax, ForEachEnumeratorInfo.Builder builder, BindingDiagnosticBag diagnostics, TypeSymbol collectionExprType)
1307(TypeSymbol)DynamicTypeSymbol.Instance :
1325TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1372private MethodArgumentInfo FindForEachPatternMethod(SyntaxNode syntax, SyntaxNode collectionSyntax, TypeSymbol patternType, string methodName, LookupResult lookupResult, bool warningsOnly, BindingDiagnosticBag diagnostics, bool isAsync)
1439private MethodArgumentInfo PerformForEachPatternOverloadResolution(SyntaxNode syntax, SyntaxNode collectionSyntax, TypeSymbol patternType, ArrayBuilder<MethodSymbol> candidateMethods, bool warningsOnly, BindingDiagnosticBag diagnostics, bool isAsync)
1646TypeSymbol enumeratorType = getEnumeratorMethod.ReturnType;
1759private void ReportEnumerableWarning(SyntaxNode collectionSyntax, BindingDiagnosticBag diagnostics, TypeSymbol enumeratorType, Symbol patternMemberCandidate)
1770internal static bool IsIEnumerable(TypeSymbol type)
1772switch (((TypeSymbol)type.OriginalDefinition).SpecialType)
1782private bool IsIAsyncEnumerable(TypeSymbol type)
1801TypeSymbol type,
1838TypeSymbol type, bool isAsync, CSharpCompilation compilation, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo,
1875TypeSymbol.Equals(@interface, result, TypeCompareKind.IgnoreTupleNames))
1888internal static bool IsIEnumerableT(TypeSymbol type, bool isAsync, CSharpCompilation compilation)
1908private void ReportPatternMemberLookupDiagnostics(SyntaxNode collectionSyntax, LookupResult lookupResult, TypeSymbol patternType, string memberName, bool warningsOnly, BindingDiagnosticBag diagnostics)
Binder\InContainerBinder.cs (3)
57internal override bool IsAccessibleHelper(Symbol symbol, TypeSymbol accessThroughType, out bool failedThroughTypeCheck, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved)
101LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\InMethodBinder.cs (10)
129TypeSymbol returnType = _methodSymbol.ReturnType;
147RefKind refKind, TypeSymbol returnType, Location errorLocation, BindingDiagnosticBag diagnostics)
151TypeSymbol originalDefinition = returnType.OriginalDefinition;
168if (TypeSymbol.Equals(originalDefinition, compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T), TypeCompareKind.ConsiderEverything) ||
169TypeSymbol.Equals(originalDefinition, compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T), TypeCompareKind.ConsiderEverything))
178internal static bool IsAsyncStreamInterface(CSharpCompilation compilation, RefKind refKind, TypeSymbol returnType)
182TypeSymbol originalDefinition = returnType.OriginalDefinition;
184if (TypeSymbol.Equals(originalDefinition, compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerable_T), TypeCompareKind.ConsiderEverything) ||
185TypeSymbol.Equals(originalDefinition, compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T), TypeCompareKind.ConsiderEverything))
195LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\AccessCheck.cs (21)
41TypeSymbol throughTypeOpt = null)
55TypeSymbol throughTypeOpt,
58ConsList<TypeSymbol> basesBeingResolved = null)
136TypeSymbol throughTypeOpt,
140ConsList<TypeSymbol> basesBeingResolved = null)
223private static bool IsNamedTypeAccessible(NamedTypeSymbol type, Symbol within, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, ConsList<TypeSymbol> basesBeingResolved = null)
301TypeSymbol throughTypeOpt,
305ConsList<TypeSymbol> basesBeingResolved = null)
346TypeSymbol throughTypeOpt,
350ConsList<TypeSymbol> basesBeingResolved = null)
418TypeSymbol throughTypeOpt,
423ConsList<TypeSymbol> basesBeingResolved = null)
461var originalThroughTypeOpt = (object)throughTypeOpt == null ? null : throughTypeOpt.OriginalDefinition as TypeSymbol;
545this TypeSymbol type,
549ConsList<TypeSymbol> basesBeingResolved = null)
565var current = type;
586var next = current.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, compilation, ref visited);
593current = (TypeSymbol)next.OriginalDefinition;
636static void getBaseInterfaces(TypeSymbol derived, ArrayBuilder<NamedTypeSymbol> baseInterfaces, PooledHashSet<NamedTypeSymbol> interfacesLookedAt, ConsList<TypeSymbol> basesBeingResolved)
Binder\Semantics\BestTypeInferrer.cs (22)
51public static TypeSymbol? InferBestType(
68IEqualityComparer<TypeSymbol> comparer = conversions.IncludeNullability ? Symbols.SymbolEqualityComparer.ConsiderEverything : Symbols.SymbolEqualityComparer.IgnoringNullable;
69HashSet<TypeSymbol> candidateTypes = new HashSet<TypeSymbol>(comparer);
73TypeSymbol? type = expr.GetTypeOrFunctionType();
96var builder = ArrayBuilder<TypeSymbol>.GetInstance(candidateTypes.Count);
98var result = GetBestType(builder, conversions, ref useSiteInfo);
116public static TypeSymbol? InferBestTypeForConditionalOperator(
132ArrayBuilder<TypeSymbol> candidateTypes = ArrayBuilder<TypeSymbol>.GetInstance();
177internal static TypeSymbol? GetBestType(
178ArrayBuilder<TypeSymbol> types,
197TypeSymbol? best = null;
201TypeSymbol? type = checkType(types[i]);
213var better = Better(best, type, conversions, ref useSiteInfo);
236TypeSymbol? type = checkType(types[i]);
241TypeSymbol? better = Better(best, type, conversions, ref useSiteInfo);
250static TypeSymbol? checkType(TypeSymbol type) =>
259private static TypeSymbol? Better(
260TypeSymbol type1,
261TypeSymbol? type2,
Binder\Semantics\Conversions\Conversions.cs (13)
44public override Conversion GetMethodGroupDelegateConversion(BoundMethodGroup source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
131protected override Conversion GetInterpolatedStringConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
153return (TypeSymbol.Equals(destination, Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) ||
154TypeSymbol.Equals(destination, Compilation.GetWellKnownType(WellKnownType.System_FormattableString), TypeCompareKind.ConsiderEverything))
161TypeSymbol targetType,
166var elementType = elementTypeWithAnnotations.Type;
221Conversion convertElement(BoundNode element, TypeSymbol elementType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
233TypeSymbol targetType,
247protected override Conversion AnalyzeImplicitUnionConversions(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
291private static (MethodSymbol, bool isFunctionPointer, CallingConventionInfo callingConventionInfo) GetDelegateInvokeOrFunctionPointerMethodIfAvailable(TypeSymbol type)
313public static bool ReportDelegateOrFunctionPointerMethodGroupDiagnostics(Binder binder, BoundMethodGroup expr, TypeSymbol targetType, BindingDiagnosticBag diagnostics)
520public override Conversion GetStackAllocConversion(BoundStackAllocArrayCreation sourceExpression, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Conversions\ConversionsBase.cs (211)
67public abstract Conversion GetMethodGroupDelegateConversion(BoundMethodGroup source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo);
71public abstract Conversion GetStackAllocConversion(BoundStackAllocArrayCreation sourceExpression, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo);
75protected abstract Conversion GetInterpolatedStringConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo);
78protected abstract Conversion GetCollectionExpressionConversion(BoundUnconvertedCollectionExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo);
98public Conversion ClassifyImplicitConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
104var sourceType = sourceExpression.Type;
169public Conversion ClassifyImplicitConversionFromType(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
204public Conversion ClassifyImplicitConversionFromTypeWhenNeitherOrBothFunctionTypes(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
234public Conversion ClassifyConversionFromExpressionType(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
248private static bool TryGetVoidConversion(TypeSymbol source, TypeSymbol destination, out Conversion conversion)
283public Conversion ClassifyConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast = false)
317public Conversion ClassifyConversionFromType(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast = false)
375private Conversion ClassifyConversionFromExpressionForCast(BoundExpression source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
429private Conversion ClassifyConversionFromTypeForCast(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
488public static Conversion FastClassifyConversion(TypeSymbol source, TypeSymbol target)
499public Conversion ClassifyBuiltInConversion(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
529public Conversion ClassifyStandardConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
541public Conversion ClassifyStandardConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
605private Conversion ClassifyStandardImplicitConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
695private Conversion ClassifyStandardImplicitConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
701Conversion classifyConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
763private Conversion ClassifyImplicitBuiltInConversionSlow(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
782private Conversion GetImplicitUserDefinedOrUnionConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
802private Conversion GetImplicitUserDefinedOrUnionConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
807private Conversion ClassifyExplicitBuiltInOnlyConversion(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
886private Conversion GetExplicitUserDefinedConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
892private Conversion GetExplicitUserDefinedConversion(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
897private Conversion DeriveStandardExplicitFromOppositeStandardImplicitConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
930var strippedSource = source.StrippedType();
931var strippedDestination = destination.StrippedType();
964public bool IsBaseInterface(TypeSymbol baseType, TypeSymbol derivedType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
999public bool IsBaseClass(TypeSymbol derivedType, TypeSymbol baseType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1010for (TypeSymbol b = derivedType.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo); (object)b != null; b = b.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo))
1044private Conversion ClassifyImplicitBuiltInConversionFromExpression(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1174private Conversion GetImplicitCollectionExpressionConversion(BoundUnconvertedCollectionExpression collectionExpression, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1186if (destination.IsNullableType(out var underlyingDestination))
1199private Conversion GetSwitchExpressionConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1228private Conversion GetConditionalExpressionConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1246private static Conversion ClassifyNullLiteralConversion(BoundExpression source, TypeSymbol destination)
1285private static Conversion ClassifyImplicitConstantExpressionConversion(BoundExpression source, TypeSymbol destination)
1298if (destination.IsNullableType(out var underlyingDestination) &&
1308private Conversion ClassifyImplicitTupleLiteralConversion(BoundTupleLiteral source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1322if (destination.IsNullableType(out var underlyingDestination))
1334private Conversion ClassifyExplicitTupleLiteralConversion(BoundTupleLiteral source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
1350if (destination.IsNullableType(out var underlyingDestination))
1364internal static bool HasImplicitConstantExpressionConversion(BoundExpression source, TypeSymbol destination)
1416private Conversion ClassifyExplicitOnlyConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
1434var sourceType = sourceExpression.Type;
1456private static bool HasImplicitEnumerationConversion(BoundExpression source, TypeSymbol destination)
1482private static LambdaConversionResult IsAnonymousFunctionCompatibleWithDelegate(UnboundLambda anonymousFunction, TypeSymbol type, CSharpCompilation compilation, bool isTargetExpressionTree)
1618var delegateType = type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
1632internal bool IsAssignableFromMulticastDelegate(TypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1639public static LambdaConversionResult IsAnonymousFunctionCompatibleWithType(UnboundLambda anonymousFunction, TypeSymbol type, CSharpCompilation compilation)
1656private static bool HasAnonymousFunctionConversion(BoundExpression source, TypeSymbol destination, CSharpCompilation compilation)
1669internal static CollectionExpressionTypeKind GetCollectionExpressionTypeKind(CSharpCompilation compilation, TypeSymbol destination, out TypeWithAnnotations elementType)
1713static bool implementsSpecialInterface(CSharpCompilation compilation, TypeSymbol targetType, SpecialType specialInterface)
1721internal static bool IsSpanOrListType(CSharpCompilation compilation, TypeSymbol targetType, WellKnownType spanType, [NotNullWhen(true)] out TypeWithAnnotations elementType)
1734internal Conversion ClassifyImplicitUserDefinedConversionForV6SwitchGoverningType(TypeSymbol sourceType, out TypeSymbol switchGoverningType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1766internal Conversion GetCallerLineNumberConversion(TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1771TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_Int32);
1791internal bool HasCallerLineNumberConversion(TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1796internal bool HasCallerInfoStringConversion(TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1798TypeSymbol expectedAttributeType = corLibrary.GetSpecialType(SpecialType.System_String);
1803public static bool HasIdentityConversion(TypeSymbol type1, TypeSymbol type2)
1808private static bool HasIdentityConversionInternal(TypeSymbol type1, TypeSymbol type2, bool includeNullability)
1830private bool HasIdentityConversionInternal(TypeSymbol type1, TypeSymbol type2)
1895var type = typeWithAnnotations.Type;
1926public Conversion ConvertExtensionMethodThisArg(TypeSymbol parameterType, TypeSymbol thisType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool isMethodGroupConversion)
1936public Conversion ClassifyImplicitExtensionMethodThisArgConversion(BoundExpression sourceExpressionOpt, TypeSymbol sourceType, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool isMethodGroupConversion)
2048private static ConversionKind GetNumericConversion(TypeSymbol source, TypeSymbol destination)
2070private static bool HasImplicitNumericConversion(TypeSymbol source, TypeSymbol destination)
2075private static bool HasExplicitNumericConversion(TypeSymbol source, TypeSymbol destination)
2113private static bool IsNumericType(TypeSymbol type)
2137private static bool HasSpecialIntPtrConversion(TypeSymbol source, TypeSymbol target)
2173var s0 = source.StrippedType();
2174var t0 = target.StrippedType();
2176TypeSymbol otherType;
2219static bool isIntPtrOrUIntPtr(TypeSymbol type) =>
2223private static bool HasExplicitEnumerationConversion(TypeSymbol source, TypeSymbol destination)
2252private Conversion ClassifyImplicitNullableConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2268TypeSymbol unwrappedDestination = destination.GetNullableUnderlyingType();
2269TypeSymbol unwrappedSource = source.StrippedType();
2298private Conversion GetImplicitTupleLiteralConversion(BoundTupleLiteral source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2316private Conversion GetExplicitTupleLiteralConversion(BoundTupleLiteral source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
2336TypeSymbol destination,
2374private Conversion ClassifyImplicitTupleConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2396private Conversion ClassifyExplicitTupleConversion(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
2419TypeSymbol source,
2420TypeSymbol destination,
2453private Conversion ClassifyExplicitNullableConversion(TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
2471TypeSymbol unwrappedSource = source.StrippedType();
2472TypeSymbol unwrappedDestination = destination.StrippedType();
2508private bool HasCovariantArrayConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2530public bool HasIdentityOrImplicitReferenceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2543private static bool HasImplicitDynamicConversionFromExpression(TypeSymbol expressionType, TypeSymbol destination)
2552private static bool HasExplicitDynamicConversion(TypeSymbol source, TypeSymbol destination)
2562private bool HasArrayConversionToInterface(ArrayTypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2643internal bool HasImplicitReferenceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2706private bool HasImplicitConversionToInterface(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2740private bool HasImplicitConversionFromArray(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2781private bool HasImplicitConversionFromDelegate(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2817private bool HasImplicitFunctionTypeConversion(FunctionTypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2828internal bool IsValidFunctionTypeConversionTarget(TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2871public bool HasImplicitTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2893private bool HasImplicitReferenceTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2936private bool HasImplicitEffectiveBaseConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2960private bool HasImplicitEffectiveInterfaceSetConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2965private bool HasVarianceCompatibleInterfaceInEffectiveInterfaceSet(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2985private bool HasAnyBaseInterfaceConversion(TypeSymbol derivedType, TypeSymbol baseType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2990private bool ImplementsVarianceCompatibleInterface(TypeSymbol derivedType, TypeSymbol baseType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3016internal bool ImplementsVarianceCompatibleInterface(NamedTypeSymbol derivedType, TypeSymbol baseType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3018return ImplementsVarianceCompatibleInterface((TypeSymbol)derivedType, baseType, ref useSiteInfo);
3021internal bool HasImplicitConversionToOrImplementsVarianceCompatibleInterface(TypeSymbol typeToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool needSupportForRefStructInterfaces)
3041private bool IsRefLikeOrAllowsRefLikeTypeImplementingVarianceCompatibleInterface(TypeSymbol typeToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3065if (expressionToCheck.Type is TypeSymbol typeToCheck && IsRefLikeOrAllowsRefLikeTypeImplementingVarianceCompatibleInterface(typeToCheck, targetInterfaceType, ref useSiteInfo))
3089private bool HasInterfaceVarianceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3108private bool HasDelegateVarianceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3169if (!TypeSymbol.Equals(typeSymbol, destination.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
3192Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, destination.OriginalDefinition, TypeCompareKind.AllIgnoreOptions));
3221TypeSymbol.Equals(destinationTypeArgument.Type, sourceTypeArgument.Type, TypeCompareKind.AllNullableIgnoreOptions) &&
3270private bool HasImplicitBoxingTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3324public bool HasBoxingConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3385internal static bool HasImplicitPointerToVoidConversion(TypeSymbol source, TypeSymbol destination)
3396internal bool HasImplicitPointerConversion(TypeSymbol? source, TypeSymbol? destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3453private bool HasIdentityOrReferenceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3476private bool HasExplicitReferenceConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3550private bool HasExplicitReferenceTypeParameterConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3602private bool HasUnboxingTypeParameterConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3625if (TypeSymbol.Equals(type, source, TypeCompareKind.ConsiderEverything2))
3653private bool HasExplicitDelegateConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3684if (!TypeSymbol.Equals(source.OriginalDefinition, destination.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
3708var sourceArg = sourceTypeArguments[i].Type;
3709var destinationArg = destinationTypeArguments[i].Type;
3742private bool HasExplicitArrayConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3803var specialDefinition = ((TypeSymbol)source.OriginalDefinition).SpecialType;
3811var sourceElement = ((NamedTypeSymbol)source).TypeArgumentWithDefinitionUseSiteDiagnostics(0, ref useSiteInfo).Type;
3812var destinationElement = destinationArray.ElementType;
3834private bool HasUnboxingConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3902private static bool HasPointerToPointerConversion(TypeSymbol source, TypeSymbol destination)
3910private static bool HasPointerToIntegerConversion(TypeSymbol source, TypeSymbol destination)
3928private static bool HasIntegerToPointerConversion(TypeSymbol source, TypeSymbol destination)
3942private static bool IsIntegerTypeSupportingPointerConversions(TypeSymbol type)
3973private bool HasImplicitSpanConversion(TypeSymbol? source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
4036private bool HasExplicitSpanConversion(TypeSymbol? source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
4057private bool IgnoreUserDefinedSpanConversions(TypeSymbol? source, TypeSymbol? target)
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (28)
22TypeSymbol source,
23TypeSymbol target,
52TypeSymbol sx = MostSpecificSourceTypeForExplicitUserDefinedConversion(u, sourceExpression, source, ref useSiteInfo);
59TypeSymbol tx = MostSpecificTargetTypeForExplicitUserDefinedConversion(u, target, ref useSiteInfo);
74private static void ComputeUserDefinedExplicitConversionTypeSet(TypeSymbol source, TypeSymbol target, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
87TypeSymbol source,
88TypeSymbol target,
130TypeSymbol source,
131TypeSymbol target,
143TypeSymbol source,
144TypeSymbol target,
271TypeSymbol convertsFrom = op.GetParameterType(0);
272TypeSymbol convertsTo = op.ReturnType;
323TypeSymbol nullableFrom = MakeNullableType(convertsFrom);
324TypeSymbol nullableTo = convertsTo.IsValidNullableTypeArgument() ? MakeNullableType(convertsTo) : convertsTo;
369private TypeSymbol MostSpecificSourceTypeForExplicitUserDefinedConversion(
372TypeSymbol source,
407if (u.Any(static (conv, source) => TypeSymbol.Equals(conv.FromType, source, TypeCompareKind.ConsiderEverything2), source))
416var result = MostEncompassedType(u, isValid, conv => conv.FromType, ref inLambdaUseSiteInfo);
427private TypeSymbol MostSpecificTargetTypeForExplicitUserDefinedConversion(
429TypeSymbol target,
461if (u.Any(static (conv, target) => TypeSymbol.Equals(conv.ToType, target, TypeCompareKind.ConsiderEverything2), target))
470var result = MostEncompassingType(u, isValid, conv => conv.ToType, ref inLambdaUseSiteInfo);
479private Conversion EncompassingExplicitConversion(BoundExpression expr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
502private Conversion EncompassingExplicitConversion(TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (56)
27TypeSymbol source,
28TypeSymbol target,
96TypeSymbol sx = MostSpecificSourceTypeForImplicitUserDefinedConversion(u, source, ref useSiteInfo);
103TypeSymbol tx = MostSpecificTargetTypeForImplicitUserDefinedConversion(u, target, ref useSiteInfo);
118private static void ComputeUserDefinedImplicitConversionTypeSet(TypeSymbol s, TypeSymbol t, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
144TypeSymbol source,
145TypeSymbol target,
283TypeSymbol source,
284TypeSymbol target,
300TypeSymbol convertsFrom = op.GetParameterType(0);
301TypeSymbol convertsTo = op.ReturnType;
348TypeSymbol nullableFrom = MakeNullableType(convertsFrom);
349TypeSymbol nullableTo = convertsTo.IsValidNullableTypeArgument() ? MakeNullableType(convertsTo) : convertsTo;
365private TypeSymbol MostSpecificSourceTypeForImplicitUserDefinedConversion(ImmutableArray<UserDefinedConversionAnalysis> u, TypeSymbol source, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
370if (u.Any(static (conv, source) => TypeSymbol.Equals(conv.FromType, source, TypeCompareKind.ConsiderEverything2), source))
381private TypeSymbol MostSpecificTargetTypeForImplicitUserDefinedConversion(ImmutableArray<UserDefinedConversionAnalysis> u, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
404if (u.Any(static (conv, target) => TypeSymbol.Equals(conv.ToType, target, TypeCompareKind.ConsiderEverything2), target))
415if (!TypeSymbol.Equals(conv.FromType, conv.Operator.GetParameterType(0), TypeCompareKind.ConsiderEverything2))
420if (!TypeSymbol.Equals(conv.ToType, conv.Operator.ReturnType, TypeCompareKind.ConsiderEverything2))
428private static int? MostSpecificConversionOperator(TypeSymbol sx, TypeSymbol tx, ImmutableArray<UserDefinedConversionAnalysis> u)
430return MostSpecificConversionOperator(conv => TypeSymbol.Equals(conv.FromType, sx, TypeCompareKind.ConsiderEverything2) && TypeSymbol.Equals(conv.ToType, tx, TypeCompareKind.ConsiderEverything2), u);
575private bool IsEncompassedBy(BoundExpression aExpr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
589private bool IsEncompassedBy(TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
594private Conversion EncompassingImplicitConversion(BoundExpression aExpr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
609private Conversion EncompassingImplicitConversion(TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
691private TypeSymbol MostEncompassedType<T>(
693Func<T, TypeSymbol> extract,
699private TypeSymbol MostEncompassedType<T>(
702Func<T, TypeSymbol> extract,
733TypeSymbol leftType = extract(left);
734TypeSymbol rightType = extract(right);
735if (TypeSymbol.Equals(leftType, rightType, TypeCompareKind.ConsiderEverything2))
753private TypeSymbol MostEncompassingType<T>(
755Func<T, TypeSymbol> extract,
761private TypeSymbol MostEncompassingType<T>(
764Func<T, TypeSymbol> extract,
772TypeSymbol leftType = extract(left);
773TypeSymbol rightType = extract(right);
774if (TypeSymbol.Equals(leftType, rightType, TypeCompareKind.ConsiderEverything2))
887private NamedTypeSymbol MakeNullableType(TypeSymbol type)
896protected UserDefinedConversionResult AnalyzeImplicitUserDefinedConversionForV6SwitchGoverningType(TypeSymbol source, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
986TypeSymbol source,
987TypeSymbol target,
1012TypeSymbol sx = MostSpecificSourceTypeForImplicitUserDefinedConversion(u, source, ref useSiteInfo);
1023TypeSymbol source,
1024TypeSymbol target,
1033TypeSymbol convertsFrom = factory.GetParameterType(0);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (43)
78TypeSymbol leftOperatorSourceOpt = left.Type?.StrippedType();
79TypeSymbol rightOperatorSourceOpt = right.Type?.StrippedType();
138var lookedInInterfaces = PooledDictionary<TypeSymbol, bool>.GetInstance();
140TypeSymbol firstOperatorSourceOpt;
141TypeSymbol secondOperatorSourceOpt;
223TypeSymbol operatorSourceOpt, bool sourceIsInterface,
225Dictionary<TypeSymbol, bool> lookedInInterfaces, ArrayBuilder<BinaryOperatorAnalysisResult> candidates)
236TypeSymbol constrainedToTypeOpt = null;
318private void AddDelegateOperation(BinaryOperatorKind kind, TypeSymbol delegateType,
373var leftType = left.Type;
375var rightType = right.Type;
393TypeSymbol systemDelegateType = _binder.Compilation.GetSpecialType(SpecialType.System_Delegate);
465TypeSymbol delegateType = leftDelegate ? leftType : rightType;
477private void GetEnumOperation(BinaryOperatorKind kind, TypeSymbol enumType, BoundExpression right, ArrayBuilder<BinaryOperatorSignature> operators)
517bool isExactSubtraction = TypeSymbol.Equals(right.Type?.StrippedType(), underlying, TypeCompareKind.ConsiderEverything2);
621var leftType = left.Type;
627var rightType = right.Type;
790Conversion getOperandConversionForAllowByRefLikeNullCheck(bool isChecked, BoundExpression operand, TypeSymbol objectType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
860static bool equalsIgnoringNullable(TypeSymbol a, TypeSymbol b) => a.Equals(b, TypeCompareKind.AllNullableIgnoreOptions);
861static bool equalsIgnoringNullableAndDynamic(TypeSymbol a, TypeSymbol b) => a.Equals(b, TypeCompareKind.AllNullableIgnoreOptions | TypeCompareKind.IgnoreDynamic);
869TypeSymbol type0,
948TypeSymbol constrainedToTypeOpt,
989private static void GetDeclaredUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, NamedTypeSymbol type, BinaryOperatorKind kind, string name, ArrayBuilder<BinaryOperatorSignature> operators)
997private static void GetDeclaredUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, ArrayBuilder<MethodSymbol> typeOperators, BinaryOperatorKind kind, string name, ArrayBuilder<BinaryOperatorSignature> operators)
1012TypeSymbol leftOperandType = op.GetParameterType(0);
1013TypeSymbol rightOperandType = op.GetParameterType(1);
1014TypeSymbol resultType = op.ReturnType;
1020void AddLiftedUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, BinaryOperatorKind kind, ArrayBuilder<BinaryOperatorSignature> operators)
1025TypeSymbol leftOperandType = op.GetParameterType(0);
1026TypeSymbol rightOperandType = op.GetParameterType(1);
1027TypeSymbol resultType = op.ReturnType;
1055private static LiftingResult UserDefinedBinaryOperatorCanBeLifted(TypeSymbol left, TypeSymbol right, TypeSymbol result, BinaryOperatorKind kind)
1084if (!TypeSymbol.Equals(left, right, TypeCompareKind.ConsiderEverything2)) return LiftingResult.NotLifted;
1374TypeSymbol op1Left, op1Right, op2Left, op2Right;
1409using var uninst1 = TemporaryArray<TypeSymbol>.Empty;
1410using var uninst2 = TemporaryArray<TypeSymbol>.Empty;
1548TypeSymbol leftOperandType = method.GetParameterType(0);
1549TypeSymbol rightOperandType = method.GetParameterType(1);
1550TypeSymbol resultType = method.ReturnType;
Binder\Semantics\Operators\BinaryOperatorSignature.cs (14)
18public readonly TypeSymbol LeftType;
19public readonly TypeSymbol RightType;
20public readonly TypeSymbol ReturnType;
22public readonly TypeSymbol ConstrainedToTypeOpt;
32public BinaryOperatorSignature(BinaryOperatorKind kind, TypeSymbol leftType, TypeSymbol rightType, TypeSymbol returnType)
43public BinaryOperatorSignature(BinaryOperatorKind kind, TypeSymbol leftType, TypeSymbol rightType, TypeSymbol returnType, MethodSymbol method, TypeSymbol constrainedToTypeOpt)
63TypeSymbol.Equals(this.LeftType, other.LeftType, TypeCompareKind.ConsiderEverything2) &&
64TypeSymbol.Equals(this.RightType, other.RightType, TypeCompareKind.ConsiderEverything2) &&
65TypeSymbol.Equals(this.ReturnType, other.ReturnType, TypeCompareKind.ConsiderEverything2) &&
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (14)
19private NamedTypeSymbol MakeNullable(TypeSymbol type)
189TypeSymbol operandType = method.GetParameterType(0);
190TypeSymbol resultType = method.ReturnType;
553var enumType = operand.Type;
650TypeSymbol declaringTypeOrTypeParameter,
659TypeSymbol constrainedToTypeOpt = declaringTypeOrTypeParameter as TypeParameterSymbol;
768TypeSymbol constrainedToTypeOpt,
809private static void GetDeclaredUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, NamedTypeSymbol type, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators)
817private static void GetDeclaredUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, IEnumerable<MethodSymbol> typeOperators, UnaryOperatorKind kind, string name, ArrayBuilder<UnaryOperatorSignature> operators)
832TypeSymbol operandType = op.GetParameterType(0);
833TypeSymbol resultType = op.ReturnType;
839private void AddLiftedUserDefinedUnaryOperators(TypeSymbol? constrainedToTypeOpt, UnaryOperatorKind kind, ArrayBuilder<UnaryOperatorSignature> operators)
859TypeSymbol operandType = op.GetParameterType(0);
860TypeSymbol resultType = op.ReturnType;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (50)
511TypeSymbol.Equals(typeParameter, _methodTypeParameters[ordinal], TypeCompareKind.ConsiderEverything2) &&
560private TypeSymbol GetFixedDelegateOrFunctionPointer(TypeSymbol delegateOrFunctionPointerType)
670TypeSymbol targetType = target.Type;
1010private static bool DoesInputTypeContain(BoundExpression argument, TypeSymbol formalParameterType, TypeParameterSymbol typeParameter)
1016var delegateOrFunctionPointerType = formalParameterType.GetDelegateOrFunctionPointerType();
1046private bool HasUnfixedParamInInputType(BoundExpression pSource, TypeSymbol pDest)
1065private static bool DoesOutputTypeContain(BoundExpression argument, TypeSymbol formalParameterType,
1072var delegateOrFunctionPointerType = formalParameterType.GetDelegateOrFunctionPointerType();
1097var returnType = method.ReturnType;
1106private bool HasUnfixedParamInOutputType(BoundExpression argument, TypeSymbol formalParameterType)
1146var formalParameterType = _formalParameterTypes[iArg].Type;
1438private bool MethodGroupReturnTypeInference(Binder binder, BoundExpression source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1453var delegateOrFunctionPointerType = target.GetDelegateOrFunctionPointerType();
1739private bool ExactSpanInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1766private static TypeWithAnnotations GetSpanElementType(TypeSymbol type)
1772private static TypeWithAnnotations GetSpanOrSZArrayElementType(TypeSymbol type)
1879if (!TypeSymbol.Equals(namedSource.OriginalDefinition, namedTarget.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
1946Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
2078private static TypeWithAnnotations GetMatchingElementType(ArrayTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2113private bool LowerBoundArrayInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2151private bool LowerBoundSpanInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2194private bool LowerBoundConstructedInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2221TypeSymbol.Equals(constructedSource.OriginalDefinition, constructedTarget.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
2258private bool LowerBoundClassInference(TypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2293if (TypeSymbol.Equals(sourceBase.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
2303private bool LowerBoundInterfaceInference(TypeSymbol source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2388Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
2427private bool LowerBoundFunctionPointerTypeInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2599var source = sourceWithAnnotations.Type;
2600var target = targetWithAnnotations.Type;
2621TypeSymbol.Equals(constructedSource.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
2655private bool UpperBoundClassInference(NamedTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2672if (TypeSymbol.Equals(targetBase.OriginalDefinition, source.OriginalDefinition, TypeCompareKind.ConsiderEverything2))
2684private bool UpperBoundInterfaceInference(NamedTypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2738Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
2777private bool UpperBoundFunctionPointerTypeInference(TypeSymbol source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3026static bool isExpressionType(TypeSymbol? type)
3042var source = sourceWithAnnotations.Type;
3043var destination = destinationWithAnnotations.Type;
3160if (TypeSymbol.Equals(currentInterface.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything))
3166else if (!TypeSymbol.Equals(matchingInterface, currentInterface, TypeCompareKind.ConsiderEverything))
3307TypeSymbol source = argument.Type;
3352private static bool IsReallyAType(TypeSymbol? type)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (76)
146TypeSymbol returnType = null,
194TypeSymbol returnType = null,
435TypeSymbol returnType,
853TypeSymbol returnType,
1332public static bool TryInferParamsCollectionIterationType(Binder binder, TypeSymbol type, out TypeWithAnnotations elementType)
1495bool typeArgumentsAccessible(ImmutableArray<TypeSymbol> typeArguments, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1497foreach (TypeSymbol arg in typeArguments)
1628private static bool IsLessDerivedThanAny<TMember>(int index, TypeSymbol type, ArrayBuilder<MemberResolutionResult<TMember>> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2186var type1 = getParameterTypeAndRefKind(i, m1.Result, m1LeastOverriddenParameters, m1.Result.ParamsElementTypeOpt, m1.LeastOverriddenMember, out RefKind parameter1RefKind);
2188var type2 = getParameterTypeAndRefKind(i, m2.Result, m2LeastOverriddenParameters, m2.Result.ParamsElementTypeOpt, m2.LeastOverriddenMember, out RefKind parameter2RefKind);
2204var type1Normalized = type1;
2205var type2Normalized = type2;
2328var type1 = getParameterTypeAndRefKind(i, m1.Result, m1LeastOverriddenParameters, m1.Result.ParamsElementTypeOpt, m1.LeastOverriddenMember, out _);
2330var type2 = getParameterTypeAndRefKind(i, m2.Result, m2LeastOverriddenParameters, m2.Result.ParamsElementTypeOpt, m2.LeastOverriddenMember, out _);
2332var type1Normalized = type1;
2333var type2Normalized = type2;
2472using (var uninst1 = TemporaryArray<TypeSymbol>.Empty)
2473using (var uninst2 = TemporaryArray<TypeSymbol>.Empty)
2560TypeSymbol t1 = m1LastParameter.Type;
2561TypeSymbol t2 = m2LastParameter.Type;
2577static TypeSymbol getParameterTypeAndRefKind(int i, MemberAnalysisResult memberResolutionResult, ImmutableArray<ParameterSymbol> parameters,
2584var type = parameter.Type;
2752private static BetterResult MoreSpecificType(ref TemporaryArray<TypeSymbol> t1, ref TemporaryArray<TypeSymbol> t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2784private static BetterResult MoreSpecificType(TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2861using var allTypeArgs1 = TemporaryArray<TypeSymbol>.Empty;
2862using var allTypeArgs2 = TemporaryArray<TypeSymbol>.Empty;
2872private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2888TypeSymbol t1,
2891TypeSymbol t2,
2942private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, Conversion conv1, TypeSymbol t2, Conversion conv2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool okToDowngradeToNeither)
3051TypeSymbol t1, Conversion conv1,
3052TypeSymbol t2, Conversion conv2,
3055var kind1 = conv1.GetCollectionExpressionTypeKind(out TypeSymbol elementType1, out _, out _);
3056var kind2 = conv2.GetCollectionExpressionTypeKind(out TypeSymbol elementType2, out _, out _);
3085TypeSymbol t1, CollectionExpressionTypeKind kind1, TypeSymbol elementType1, ImmutableArray<Conversion> underlyingElementConversions1,
3086TypeSymbol t2, CollectionExpressionTypeKind kind2, TypeSymbol elementType2, ImmutableArray<Conversion> underlyingElementConversions2,
3192TypeSymbol t1, CollectionExpressionTypeKind kind1, TypeSymbol elementType1,
3193TypeSymbol t2, CollectionExpressionTypeKind kind2, TypeSymbol elementType2,
3223bool hasImplicitConversion(TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) =>
3227private BetterResult BetterParamsCollectionType(TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3249private static bool IsSZArrayOrArrayInterface(TypeSymbol type, out TypeSymbol elementType)
3267private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3291TypeSymbol y;
3383private bool ExpressionMatchExactly(BoundTupleLiteral tupleSource, TypeSymbol targetType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3454TypeSymbol type1,
3455TypeSymbol type2,
3470TypeSymbol type1,
3472TypeSymbol type2,
3482TypeSymbol type1,
3484TypeSymbol type2,
3582TypeSymbol r1 = invoke1.ReturnType;
3583TypeSymbol r2 = invoke2.ReturnType;
3658static bool isBetterSpanConversionTarget(TypeSymbol type1, TypeSymbol type2)
3663var type1Element = ((NamedTypeSymbol)type1).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
3664var type2Element = ((NamedTypeSymbol)type2).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
3686private bool CanDowngradeConversionFromLambdaToNeither(BetterResult currentResult, UnboundLambda lambda, TypeSymbol type1, TypeSymbol type2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool fromTypeAnalysis)
3715TypeSymbol r1 = invoke1.ReturnType;
3716TypeSymbol r2 = invoke2.ReturnType;
3810private static bool IsSignedIntegralType(TypeSymbol type)
3831private static bool IsUnsignedIntegralType(TypeSymbol type)
4700TypeSymbol parameterType,
4733var argType = argument.Type;
4773private static bool TypeContainsTypeParameterFromContainer(Symbol container, TypeSymbol parameterType)
Binder\WithExternAndUsingAliasesBinder.cs (5)
34protected abstract ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved);
37LookupResult result, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
84internal bool IsUsingAlias(string name, bool callerIsSemanticModel, ConsList<TypeSymbol>? basesBeingResolved)
151protected override ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved)
255protected override ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved)
BoundTree\Constructors.cs (32)
30TypeSymbol type,
43TypeSymbol type,
54TypeSymbol typeSymbol)
100TypeSymbol type,
118TypeSymbol type)
309TypeSymbol type,
324TypeSymbol type)
335public static BoundConversion SynthesizedNonUserDefined(SyntaxNode syntax, BoundExpression operand, Conversion conversion, TypeSymbol type, ConstantValue? constantValueOpt = null)
365TypeSymbol type,
393TypeSymbol type,
419TypeSymbol? constrainedToTypeOpt,
422TypeSymbol type,
440TypeSymbol? constrainedToTypeOpt,
444TypeSymbol type,
453TypeSymbol? constrainedToTypeOpt,
457TypeSymbol type)
500public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, TypeSymbol type, bool hasErrors = false)
532TypeSymbol type, bool isRef = false, bool hasErrors = false)
540public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol type)
620public BoundDefaultExpression(SyntaxNode syntax, TypeSymbol type, bool hasErrors = false)
636public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
644public BoundDagTemp(SyntaxNode syntax, TypeSymbol type, BoundDagEvaluation? source)
663TypeSymbol type,
677TypeSymbol type)
689TypeSymbol? constrainedToTypeOpt,
691TypeSymbol type,
701TypeSymbol? constrainedToTypeOpt,
703TypeSymbol type)
714TypeSymbol? constrainedToTypeOpt,
720TypeSymbol type,
726public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, TypeSymbol type)
BoundTree\UnboundLambda.cs (16)
85public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? delegateType, InferredLambdaReturnType inferredReturnType)
195internal static readonly TypeSymbol NoReturnExpression = new UnsupportedMetadataTypeSymbol();
198BoundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions)
205UnboundLambda node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions)
215BoundNode node, Binder binder, TypeSymbol? delegateType, bool isAsync, ConversionsBase conversions, bool withDependencies)
260TypeSymbol? delegateType,
283var bestType = returns[0].expr.GetTypeOrFunctionType();
304var bestType = BestTypeInferrer.InferBestType(returns.SelectAsArray(pair => pair.expr), conversions, ref useSiteInfo, out inferredFromFunctionType);
392var type = (expression is null) ?
507public void GenerateAnonymousFunctionConversionError(BindingDiagnosticBag diagnostics, TypeSymbol targetType) { Data.GenerateAnonymousFunctionConversionError(diagnostics, targetType); }
513public TypeSymbol ParameterType(int index) { return ParameterTypeWithAnnotations(index).Type; }
630public virtual void GenerateAnonymousFunctionConversionError(BindingDiagnosticBag diagnostics, TypeSymbol targetType)
649internal IEnumerable<TypeSymbol> InferredReturnTypes()
1099Debug.Assert(taskLikeReturnTypeOpt is null || ((object)taskLikeReturnTypeOpt == taskLikeReturnTypeOpt.ConstructedFrom && taskLikeReturnTypeOpt.IsCustomTaskType(out var builderArgument)));
1116!TypeSymbol.Equals(other.TaskLikeReturnTypeOpt, this.TaskLikeReturnTypeOpt, TypeCompareKind.ConsiderEverything2))
1189if (delegateReturnType.IsCustomTaskType(out var builderType))
CodeGen\CodeGenerator_RefSafety.cs (4)
12/// <inheritdoc cref="MightEscapeTemporaryRefs(bool, TypeSymbol, RefKind, ParameterSymbol?, ImmutableArray{ParameterSymbol})"/>
23/// <inheritdoc cref="MightEscapeTemporaryRefs(bool, TypeSymbol, RefKind, ParameterSymbol?, ImmutableArray{ParameterSymbol})"/>
34/// <inheritdoc cref="MightEscapeTemporaryRefs(bool, TypeSymbol, RefKind, ParameterSymbol?, ImmutableArray{ParameterSymbol})"/>
63TypeSymbol returnType,
CodeGen\EmitArrayInitializer.cs (5)
225TypeSymbol type = init.Type.EnumUnderlyingTypeOrSelf();
246private ArrayInitializerStyle ShouldEmitBlockInitializer(TypeSymbol elementType, ImmutableArray<BoundExpression> inits)
470TypeSymbol? elementType = null;
630bool tryEmitAsCachedArrayFromBlob(NamedTypeSymbol spanType, BoundExpression wrappedExpression, int elementCount, ImmutableArray<byte> data, ref ArrayTypeSymbol arrayType, TypeSymbol elementType)
680bool tryEmitAsCachedArrayOfConstants(BoundArrayCreation arrayCreation, ArrayTypeSymbol arrayType, TypeSymbol elementType, NamedTypeSymbol spanType, bool used, BoundExpression? inPlaceTarget, out bool avoidInPlace)
CodeGen\EmitExpression.cs (41)
382var receiverType = expression.Type;
409var receiverType = receiver.Type;
819var thisType = thisRef.Type;
1027var elementType = arrayAccess.Type;
1181TypeSymbol fieldType = field.Type;
1330var type = expr.Type;
1437var parameterType = parameter.ParameterSymbol.Type;
1442private void EmitLoadIndirect(TypeSymbol type, SyntaxNode syntaxNode)
1656Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2));
1733var parentCallReceiverType = call.Type;
1858var receiverType = receiver.Type;
1894Debug.Assert(TypeSymbol.Equals(receiverType, methodContainingType, TypeCompareKind.ObliviousNullableModifierMatchesAny));
1948var receiverType = receiver.Type;
2060var receiverType = receiver.Type;
2123var receiverType = receiver.Type;
2641var rightType = right.Type;
3262var elementType = arrayType.ElementType;
3360private void EmitIndirectStore(TypeSymbol type, SyntaxNode syntaxNode)
3462var operandType = operand.Type;
3463var targetType = asOp.Type;
3481private void EmitDefaultValue(TypeSymbol type, bool used, SyntaxNode syntaxNode)
3525private void EmitConstantExpression(TypeSymbol type, ConstantValue constantValue, bool used, SyntaxNode syntaxNode)
3544private void EmitInitObj(TypeSymbol type, bool used, SyntaxNode syntaxNode)
3567TypeSymbol type = boundTypeOfOperator.SourceType.Type;
3575TypeSymbol type = boundSizeOfOperator.SourceType.Type;
3742if (!TypeSymbol.Equals(node.Type, getMethod.ReturnType, TypeCompareKind.ConsiderEverything2))
3769if (!TypeSymbol.Equals(node.Type, getField.ReturnType, TypeCompareKind.ConsiderEverything2))
3834var mergeTypeOfAlternative = StackMergeType(expr.Alternative);
3842else if (expr.Type.IsInterfaceType() && !TypeSymbol.Equals(expr.Type, mergeTypeOfAlternative, TypeCompareKind.ConsiderEverything2))
3860var mergeTypeOfConsequence = StackMergeType(expr.Consequence);
3866else if (expr.Type.IsInterfaceType() && !TypeSymbol.Equals(expr.Type, mergeTypeOfConsequence, TypeCompareKind.ConsiderEverything2))
3895var mergeTypeOfLeftValue = StackMergeType(expr.LeftOperand);
3903else if (expr.Type.IsInterfaceType() && !TypeSymbol.Equals(expr.Type, mergeTypeOfLeftValue, TypeCompareKind.ConsiderEverything2))
3927var mergeTypeOfRightValue = StackMergeType(expr.RightOperand);
3953private TypeSymbol StackMergeType(BoundExpression expr)
4011private static bool IsVarianceCast(TypeSymbol to, TypeSymbol from)
4013if (TypeSymbol.Equals(to, from, TypeCompareKind.ConsiderEverything2))
4031return (to.IsDelegateType() && !TypeSymbol.Equals(to, from, TypeCompareKind.ConsiderEverything2)) ||
4035private void EmitStaticCast(TypeSymbol to, SyntaxNode syntax)
4055private void EmitBox(TypeSymbol type, SyntaxNode syntaxNode)
CodeGen\EmitStackAllocInitializer.cs (7)
16private void EmitStackAlloc(TypeSymbol type, BoundArrayInitialization? inits, BoundExpression count)
27var elementType = (type.TypeKind == TypeKind.Pointer
75Debug.Assert(TypeSymbol.Equals(readOnlySpan.OriginalDefinition, _module.Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.ConsiderEverything));
129private ArrayInitializerStyle ShouldEmitBlockInitializerForStackAlloc(TypeSymbol elementType, ImmutableArray<BoundExpression> inits)
181private void EmitElementStackAllocInitializers(TypeSymbol elementType, ImmutableArray<BoundExpression> inits, bool includeConstants)
199private void EmitPointerElementAccess(BoundExpression init, TypeSymbol elementType, int elementTypeSizeInBytes, int index)
226private void EmitIntConstantOrSizeOf(BoundExpression init, TypeSymbol elementType, int elementTypeSizeInBytes)
CodeGen\EmitStatement.cs (12)
178var exprType = thrown.Type;
200private static bool CanPassToBrfalse(TypeSymbol ts)
252var nonConstType = nonConstOp.Type;
530var receiverType = receiver.Type;
610var conditionType = condition.Type;
1372TypeSymbol keyType)
1487void emitFinalDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, TypeSymbol keyType, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode)
1517TypeSymbol keyType)
1658private Cci.IMethodReference? GetLengthMethodRef(SyntaxNode syntaxNode, TypeSymbol keyType, bool isReadOnlySpan, bool isSpanOrReadOnlySpan)
1682private Microsoft.Cci.IMethodReference? GetIndexerRef(SyntaxNode syntaxNode, TypeSymbol keyType, bool isReadOnlySpan, bool isSpanOrReadOnlySpan)
1828TypeSymbol pointedAtType = pointerType.PointedAtType;
1934private LocalDefinition AllocateTemp(TypeSymbol type, SyntaxNode syntaxNode, LocalSlotConstraints slotConstraints = LocalSlotConstraints.None)
Compilation\CSharpCompilation.cs (44)
63private TypeSymbol? _lazyHostObjectTypeSymbol;
151private ConcurrentCache<TypeSymbol, NamedTypeSymbol>? _lazyTypeToNullableVersion;
379var methodReturn = method.ReturnType.OriginalDefinition;
1766private ConcurrentCache<TypeSymbol, NamedTypeSymbol> TypeToNullableVersion
1770return InterlockedOperations.Initialize(ref _lazyTypeToNullableVersion, static () => new ConcurrentCache<TypeSymbol, NamedTypeSymbol>(size: 100));
1781internal NamedTypeSymbol GetOrCreateNullableType(TypeSymbol typeArgument)
1798static bool isSupportedType(TypeSymbol typeArgument)
1842internal TypeSymbol GetTypeByReflectionType(Type type, BindingDiagnosticBag diagnostics)
1844var result = Assembly.GetTypeByReflectionType(type);
1869internal TypeSymbol? GetHostObjectTypeSymbol()
1873TypeSymbol? symbol = Assembly.GetTypeByReflectionType(HostObjectType);
1915internal new TypeSymbol DynamicType
2281if (!(TypeSymbol.Equals(namedType.ConstructedFrom, GetWellKnownType(WellKnownType.System_Threading_Tasks_Task), TypeCompareKind.ConsiderEverything2) ||
2282TypeSymbol.Equals(namedType.ConstructedFrom, GetWellKnownType(WellKnownType.System_Threading_Tasks_Task_T), TypeCompareKind.ConsiderEverything2)))
2299var returnType = result?.Type ?? runtimeAwaitCall!.Type;
2317TypeSymbol returnType = method.ReturnType;
2412TypeSymbol? cssource = source.EnsureCSharpSymbolOrNull(nameof(source));
2413TypeSymbol? csdest = destination.EnsureCSharpSymbolOrNull(nameof(destination));
2471internal ArrayTypeSymbol CreateArrayTypeSymbol(TypeSymbol elementType, int rank = 1, NullableAnnotation elementNullableAnnotation = NullableAnnotation.Oblivious)
2489internal PointerTypeSymbol CreatePointerTypeSymbol(TypeSymbol elementType, NullableAnnotation elementNullableAnnotation = NullableAnnotation.Oblivious)
2506TypeSymbol? throughType0 = throughType.EnsureCSharpSymbolOrNull(nameof(throughType));
4358var elementType = typeSymbol.EnsureCSharpSymbolOrNull($"{nameof(elementTypes)}[{i}]");
4424var type = memberTypes[i].GetSymbol();
4442var csharpReturnType = returnType.EnsureCSharpSymbolOrNull(nameof(returnType));
4443var csharpLeftType = leftType.EnsureCSharpSymbolOrNull(nameof(leftType));
4444var csharpRightType = rightType.EnsureCSharpSymbolOrNull(nameof(rightType));
4512TypeSymbol.Equals(csharpLeftType, csharpRightType, TypeCompareKind.ConsiderEverything))
4525TypeSymbol.Equals(csharpLeftType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4546TypeSymbol.Equals(csharpLeftType, csharpRightType, TypeCompareKind.ConsiderEverything))
4557TypeSymbol.Equals(csharpLeftType, csharpRightType, TypeCompareKind.ConsiderEverything) &&
4558TypeSymbol.Equals(csharpReturnType, csharpRightType, TypeCompareKind.ConsiderEverything))
4571TypeSymbol.Equals(csharpLeftType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4578TypeSymbol.Equals(csharpRightType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4587TypeSymbol.Equals(csharpLeftType, csharpRightType, TypeCompareKind.ConsiderEverything))
4611TypeSymbol.Equals(csharpLeftType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4620TypeSymbol.Equals(csharpRightType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4629TypeSymbol.Equals(csharpLeftType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4638TypeSymbol.Equals(csharpLeftType, csharpRightType, TypeCompareKind.ConsiderEverything))
4655bool isAllowedPointerArithmeticIntegralType(TypeSymbol type)
4658bool isReadOnlySpanOfByteType(TypeSymbol type)
4667var csharpReturnType = returnType.EnsureCSharpSymbolOrNull(nameof(returnType));
4668var csharpOperandType = operandType.EnsureCSharpSymbolOrNull(nameof(operandType));
4721TypeSymbol.Equals(csharpOperandType, csharpReturnType, TypeCompareKind.ConsiderEverything))
4729TypeSymbol.Equals(csharpOperandType, csharpReturnType, TypeCompareKind.ConsiderEverything))
Compilation\CSharpSemanticModel.cs (25)
980var declarationTypeSymbol = declarationType.GetSymbol();
1607TypeSymbol containingType = binder.ContainingType;
1608TypeSymbol baseType = null;
1671if (includeExtensionMembers && container is TypeSymbol receiverType)
2057TypeSymbol type = null;
2097TypeSymbol convertedType;
2276static (TypeSymbol, NullabilityInfo) getTypeAndNullability(BoundExpression expr) => (expr.Type, expr.TopLevelNullability);
2327TypeSymbol type = unwrapped as TypeSymbol;
2364TypeSymbol type = UnwrapAlias(symbol) as TypeSymbol;
2844TypeSymbol cdestination = destination.EnsureCSharpSymbolOrNull(nameof(destination));
2890internal abstract Conversion ClassifyConversionForCast(ExpressionSyntax expression, TypeSymbol destination);
2906internal Conversion ClassifyConversionForCast(int position, ExpressionSyntax expression, TypeSymbol destination)
3750private static ParameterSymbol GetThisParameter(TypeSymbol typeOfThis, NamedTypeSymbol containingType, Symbol containingMember, out LookupResultKind resultKind)
3857TypeSymbol opType = increment.Operand.Type.StrippedType();
3909private static Symbol GetIntrinsicOperatorSymbol(BinaryOperatorKind op, bool isDynamic, TypeSymbol leftType, TypeSymbol rightType, TypeSymbol returnType, bool isChecked)
4013TypeSymbol.Equals((TypeSymbol)unwrappedSymbols[0], boundAttribute.Type.GetNonErrorGuess(), TypeCompareKind.ConsiderEverything2));
4110TypeSymbol type = boundNode.Type;
4699TypeSymbol receiverType,
4725TypeSymbol receiverType,
4768TypeSymbol receiverType = null;
Emitter\Model\PEModuleBuilder.cs (9)
28internal abstract class PEModuleBuilder : PEModuleBuilder<CSharpCompilation, SourceModuleSymbol, AssemblySymbol, TypeSymbol, NamedTypeSymbol, MethodSymbol, SyntaxNode, NoPia.EmbeddedTypesManager, ModuleCompilationState>
35private readonly ConcurrentSet<TypeSymbol> _reportedErrorTypesMap = new ConcurrentSet<TypeSymbol>();
1288TypeSymbol typeSymbol,
1800internal SynthesizedAttributeData SynthesizeNativeIntegerAttribute(Symbol symbol, TypeSymbol type)
2018TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
2019TypeSymbol unmatchedValueType = factory.SpecialType(SpecialType.System_Object);
2065TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
2085TypeSymbol returnType = factory.SpecialType(SpecialType.System_Void);
FlowAnalysis\NullableWalker.cs (179)
145public VisitResult(TypeSymbol? type, NullableAnnotation annotation, NullableFlowState state)
149Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything));
241private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)>.Builder? _analyzedNullabilityMapOpt;
509ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt,
999static ImmutableArray<Symbol> getAllTypeAndRequiredMembers(TypeSymbol containingType)
1627ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> analyzedNullabilitiesMap;
1632private static (SnapshotManager?, ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>) AnalyzeWithSemanticInfo(
1642var analyzedNullabilities = ImmutableDictionary.CreateBuilder<BoundExpression, (NullabilityInfo, TypeSymbol?)>(EqualityComparer<BoundExpression>.Default, NullabilityInfoTypeComparer.Instance);
1700var analyzedNullabilities = ImmutableDictionary.CreateBuilder<BoundExpression, (NullabilityInfo, TypeSymbol?)>(EqualityComparer<BoundExpression>.Default, NullabilityInfoTypeComparer.Instance);
1740private static BoundNode Rewrite(ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> updatedNullabilities, SnapshotManager? snapshotManager, BoundNode node, ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols)
1867ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt,
2165TypeSymbol slotType = NominalSlotType(result);
2166TypeSymbol? nodeType = node.Type;
2202var operandType = operand.Type;
2203var convertedType = conv.Type;
2220TypeSymbol.Equals(conv.Type, conv.Operand.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes):
2389private static object GetTypeAsDiagnosticArgument(TypeSymbol? typeOpt)
2747private void InheritNullableStateOfTrackableStruct(TypeSymbol targetType, int targetSlot, int valueSlot, bool isDefaultValue, int skipSlot = -1)
2772TypeSymbol? possibleBase = possibleMember.ContainingType;
2780TypeSymbol possibleDerived = NominalSlotType(slot);
2864private TypeSymbol NominalSlotType(int slot)
2896private void InheritDefaultState(TypeSymbol targetType, int targetSlot)
2901var actualType = GetTypeOrReturnType(_variables[targetSlot].Symbol);
2926private static TypeSymbol GetTypeOrReturnType(Symbol symbol) => symbol.GetTypeOrReturnType().Type;
3815private static bool AreCloseEnough(TypeSymbol? typeA, TypeSymbol? typeB)
3831static bool canIgnoreAnyType(TypeSymbol type)
3835static bool canIgnoreType(TypeSymbol type)
3881private static bool TypeAllowsConditionalState(TypeSymbol? type)
3887private void UnsplitIfNeeded(TypeSymbol? type)
3957var elementConversionCompletions = ArrayBuilder<Action<TypeWithAnnotations /*targetElementType*/, TypeSymbol /*targetCollectionType*/>>.GetInstance();
3986Action<TypeSymbol>? visitCollectionCreationArguments(BoundCollectionExpression node)
4096void visitElement(BoundNode element, BoundCollectionExpression node, TypeWithAnnotations targetElementType, ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> elementConversionCompletions)
4190Action<TypeSymbol>? collectionCreationCompletion,
4191ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> completions)
4193var strippedTargetCollectionType = targetCollectionType.Type.StrippedType();
4194Debug.Assert(TypeSymbol.Equals(strippedTargetCollectionType, node.Type, TypeCompareKind.AllIgnoreOptions));
4244(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(BoundCollectionExpression node, TypeSymbol collectionType)
4309var type = node.Type;
4311(int slot, NullableFlowState resultState, Func<TypeSymbol, MethodSymbol?, int>? initialStateInferenceCompletion) =
4326TypeSymbol? type,
4329Func<TypeSymbol, MethodSymbol?, int>? initialStateInferenceCompletion,
4358Func<TypeSymbol, MethodSymbol?, int> initialStateInferenceCompletion,
4367Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4369var type = resultTypeWithAnnotations.Type;
4382static MethodSymbol? getConstructor(BoundObjectCreationExpressionBase node, TypeSymbol type)
4394(int slot, NullableFlowState resultState, Func<TypeSymbol, MethodSymbol?, int>? completion) inferInitialObjectState(
4395BoundExpression node, TypeSymbol type, MethodSymbol? constructor,
4470static bool isSuitableUnionConstruction(TypeSymbol type, [NotNullWhen(true)] MethodSymbol? constructor, [NotNullWhen(true)] out PropertySymbol? valueProperty)
4487Func<TypeSymbol, MethodSymbol?, int> inferInitialObjectStateAsContinuation(
4493return (TypeSymbol type, MethodSymbol? constructor) =>
4530private InitializerCompletionAfterTargetType? VisitObjectCreationInitializer(int containingSlot, TypeSymbol containingType, BoundObjectInitializerExpressionBase node, bool delayCompletionForType)
4580private InitializerCompletionAfterTargetType? VisitObjectElementInitializer(int containingSlot, TypeSymbol containingType, BoundAssignmentOperator node, bool delayCompletionForType)
4597InitializerCompletionAfterTargetType? visitMemberInitializer(int containingSlot, TypeSymbol containingType, BoundAssignmentOperator node, bool delayCompletionForType)
4667return (int containingSlot, TypeSymbol containingType) =>
4696InitializerCompletionAfterUpdatedSymbol? visitNestedInitializer(int containingSlot, TypeSymbol containingType, Symbol symbol, BoundObjectInitializerExpressionBase initializer, bool delayCompletionForType)
4780void getAdjustedArgumentsInfo(BoundObjectInitializerMember objectInitializer, TypeSymbol containingType, Symbol? symbol,
4793Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4807void getSymbolAndParameters(BoundObjectInitializerMember objectInitializer, TypeSymbol containingType,
4821Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4841private InitializerCompletionAfterTargetType? VisitCollectionElementInitializer(BoundCollectionElementInitializer node, TypeSymbol containingType, bool delayCompletionForType)
4868Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4869Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4877TypeSymbol containingType,
4907return (int containingSlot, TypeSymbol containingType) =>
4917static MethodSymbol addMethodAsMemberOfContainingType(BoundCollectionElementInitializer node, TypeSymbol containingType, ref ImmutableArray<VisitResult> argumentResults)
4926Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4927Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4965protected override bool IsEmptyStructType(TypeSymbol type)
5101var arrayType = VisitArrayInitialization(node.Type, initialization, node.HasErrors);
5106private TypeSymbol VisitArrayInitialization(TypeSymbol type, BoundArrayInitialization initialization, bool hasErrors)
5123var resultType = type;
5156TypeSymbol? bestType = null;
5211static TypeSymbol setSpanElementType(NamedTypeSymbol namedType, TypeWithAnnotations elementType)
5275TypeSymbol? bestType = BestTypeInferrer.InferBestType(placeholders, walker._conversions, ref discardedUseSiteInfo, out inferredFromFunctionType);
5359var expressionType = VisitRvalueWithState(node.Expression).Type;
5378private TypeWithState InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType, TypeWithState leftType, TypeWithState rightType)
5618TypeSymbol returnType,
5705TypeSymbol methodContainer = method.ContainingType;
5710TypeSymbol asMemberOfType = getTypeIfContainingType(methodContainer, leftUnderlyingType.Type, leftOperand) ??
5751TypeSymbol? getTypeIfContainingType(TypeSymbol baseType, TypeSymbol? derivedType, BoundExpression operand)
5948var receiverType = conditional.Receiver.Type!;
5994private static bool PossiblyNullableType([NotNullWhen(true)] TypeSymbol? operandType) => operandType?.CanContainNull() == true;
6050private void LearnFromNullTest(int slot, TypeSymbol? expressionType, ref LocalState state, bool markDependentSlotsNotNull)
6070private void MarkDependentSlotsNotNull(int slot, TypeSymbol expressionType, ref LocalState state, int depth = 2)
6092static IEnumerable<Symbol> getMembers(TypeSymbol type)
6110static NamedTypeSymbol effectiveBase(TypeSymbol type) => type switch
6116static ImmutableArray<NamedTypeSymbol> inheritedInterfaces(TypeSymbol type) => type switch
6162TypeSymbol.Equals(targetType.Type.GetNullableUnderlyingType(), node.Type, TypeCompareKind.AllIgnoreOptions));
6172Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions));
6215var leftResultType = leftResult.Type;
6216var rightResultType = rightResult.Type;
6232(TypeSymbol ResultType, NullableFlowState LeftState) getLeftResultType(TypeSymbol leftType, TypeSymbol rightType)
6252(TypeSymbol ResultType, NullableFlowState LeftState) getResultStateWithRightType(TypeSymbol leftType, TypeSymbol rightType)
6439TypeSymbol accessType = accessTypeWithAnnotations.Type;
6440var oldType = node.Type;
6441var resultType =
6505TypeSymbol? refResultType = node.Type?.SetUnknownNullabilityForReferenceTypes();
6541TypeSymbol? resultType;
6766var rvalueType = _currentConditionalReceiverVisitResult.RValueType.Type;
7168static bool isWellKnownEqualityMethodOrImplementation(CSharpCompilation compilation, MethodSymbol method, TypeSymbol? receiverType, WellKnownMember wellKnownMember)
7188for (var baseType = receiverType; baseType is object && method is object; baseType = baseType.BaseTypeNoUseSiteDiagnostics)
7366var type = receiverType.Type;
7541TypeSymbol? receiverType,
7556TypeSymbol? receiverType,
7570private delegate void InitializerCompletionAfterTargetType(int containingSlot, TypeSymbol containingType);
7585TypeSymbol? receiverType,
7624TypeSymbol? receiverType,
7817TypeSymbol? receiverType,
7990private void ApplyMemberPostConditions(TypeSymbol? receiverType, int receiverSlot, MethodSymbol method)
8039void applyMemberPostConditions(int receiverSlot, TypeSymbol type, ImmutableArray<string> members, ref LocalState state)
8052void markMembersAsNotNull(int receiverSlot, TypeSymbol type, string memberName, ref LocalState state)
8243var argumentResultType = resultType.Type;
8331static bool hasNoNonNullableCounterpart(TypeSymbol? type)
8358TypeSymbol? receiverType,
8475void trackNullableStateForAssignment(TypeSymbol? receiverType, BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations, RefKind refKind, ParameterSymbol parameter)
8500static bool hasConditionalPostCondition(TypeSymbol? receiverType, FlowAnalysisAnnotations annotations, RefKind refKind, ParameterSymbol parameter)
8511static bool isUnionTryGetValueValue(TypeSymbol? receiverType, RefKind refKind, ParameterSymbol parameter)
8542static TypeWithState applyPostConditionsWhenTrue(TypeSymbol? receiverType, TypeWithState typeWithState, FlowAnalysisAnnotations annotations, RefKind refKind, ParameterSymbol parameter)
9070private Conversion GenerateConversionForConditionalOperator(BoundExpression sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool reportMismatch, bool isChecked)
9081private Conversion GenerateConversion(Conversions conversions, BoundExpression? sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool fromExplicitCast, bool extensionMethodThisArgument, bool isChecked)
9159private static Symbol AsMemberOfType(TypeSymbol? type, Symbol symbol)
9374private static bool AreNullableAndUnderlyingTypes([NotNullWhen(true)] TypeSymbol? nullableTypeOpt, [NotNullWhen(true)] TypeSymbol? underlyingTypeOpt, out TypeWithAnnotations underlyingTypeWithAnnotations)
9500private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot)
9517TypeSymbol targetType,
9518TypeSymbol operandType,
9684private void ReportNullabilityMismatchWithTargetDelegate(Location location, TypeSymbol targetType, MethodSymbol targetInvokeMethod, MethodSymbol sourceInvokeMethod, bool invokedAsExtensionMethod)
9702void reportBadDelegateReturn(BindingDiagnosticBag bag, MethodSymbol targetInvokeMethod, MethodSymbol sourceInvokeMethod, bool topLevel, (TypeSymbol targetType, Location location) arg)
9709void reportBadDelegateParameter(BindingDiagnosticBag bag, MethodSymbol sourceInvokeMethod, MethodSymbol targetInvokeMethod, ParameterSymbol parameter, bool topLevel, (TypeSymbol targetType, Location location) arg)
9889TypeSymbol targetType = targetTypeWithNullability.Type;
9913static (MethodSymbol invokeSignature, ImmutableArray<ParameterSymbol>) getDelegateOrFunctionPointerInfo(TypeSymbol targetType)
10241static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType)
10265var type = operandType.Type;
10296var type = operandType.Type;
10464TypeSymbol targetType = targetTypeWithNullability.Type;
10631Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
10632Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
10633Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
10651TypeSymbol targetType = targetTypeWithNullability.Type;
10670Debug.Assert(TypeSymbol.Equals(analysis.FromType, parameterType.Type, TypeCompareKind.AllIgnoreOptions));
10671Debug.Assert(TypeSymbol.Equals(toType, analysis.ToType, TypeCompareKind.AllIgnoreOptions));
10807TypeSymbol type = typeNeedsLifting ? MakeNullableOf(returnType) : returnType.Type;
10816var type = typeWithState.Type;
10832private TypeSymbol MakeNullableOf(TypeWithAnnotations underlying)
10941Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
11019TypeSymbol argType = arg.Type;
11038TypeSymbol argType = arg.Type;
12081private void ReportNullabilityMismatchInRefArgument(BoundExpression argument, TypeSymbol argumentType, ParameterSymbol parameter, TypeSymbol parameterType)
12093private void ReportNullabilityMismatchInArgument(SyntaxNode argument, TypeSymbol argumentType, ParameterSymbol parameter, TypeSymbol parameterType, bool forOutput)
12098private void ReportNullabilityMismatchInArgument(Location argumentLocation, TypeSymbol argumentType, ParameterSymbol? parameterOpt, TypeSymbol parameterType, bool forOutput)
12244var receiverType = VisitRvalueWithState(receiverOpt).Type;
12399private int GetNullableOfTValueSlot(TypeSymbol containingType, int containingSlot, out Symbol? valueProperty, bool forceSlotEvenIfEmpty = false)
12402Debug.Assert(TypeSymbol.Equals(NominalSlotType(containingSlot), containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
12463var resultType = resultTypeWithState.Type;
12575TypeSymbol? getEnumeratorType;
13165TypeSymbol type = node.Type;
13218var type = node.Type;
13475var resultTypeSymbol = resultType.Type;
13495private bool ReportPossibleNullReceiverIfNeeded(TypeSymbol type, NullableFlowState state, bool checkNullableValueType, SyntaxNode syntax, out bool reportedDiagnostic)
13536private static bool IsNullabilityMismatch(TypeSymbol type1, TypeSymbol type2)
13623var type = VisitArrayInitialization(node.Type, initialization, node.HasErrors);
14384private sealed class NullabilityInfoTypeComparer : IEqualityComparer<(NullabilityInfo info, TypeSymbol? type)>
14388public bool Equals((NullabilityInfo info, TypeSymbol? type) x, (NullabilityInfo info, TypeSymbol? type) y)
14394public int GetHashCode((NullabilityInfo info, TypeSymbol? type) obj)
FlowAnalysis\NullableWalker_Patterns.cs (13)
155TypeSymbol inputType,
281var originalInputType = node.Expression.Type;
411var tempMap = PooledDictionary<BoundDagTemp, (int slot, TypeSymbol type)>.GetInstance();
440(int inputSlot, TypeSymbol inputType) = tempMap.TryGetValue(evaluation.Input, out var slotAndType) ? slotAndType : throw ExceptionUtilities.Unreachable();
543(int inputSlot, TypeSymbol inputType) = slotAndType;
688(int inputSlot, TypeSymbol inputType) = tempMap.TryGetValue(evaluation.Input, out var slotAndType) ? slotAndType : throw ExceptionUtilities.Unreachable();
825PropertySymbol getReInferredProperty(TypeSymbol inputType, BoundDagPropertyEvaluation e)
851void addToTempMap(BoundDagTemp output, int slot, TypeSymbol type)
868bool isDerivedType(TypeSymbol derivedType, TypeSymbol baseType)
948TypeWithAnnotations getIndexerOutputType(TypeSymbol inputType, BoundExpression e, bool isSlice)
1039var originalInputType = node.Expression.Type;
1107TypeSymbol inferredType =
Generated\BoundNodes.xml.Generated.cs (1120)
413protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
419protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type)
425public TypeSymbol? Type { get; }
430protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
435protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type)
444protected BoundEarlyValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
449protected BoundEarlyValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type)
458public BoundValuePlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
463public BoundValuePlaceholder(SyntaxNode syntax, TypeSymbol? type)
472public BoundValuePlaceholder Update(TypeSymbol? type)
474if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
486public BoundCapturedReceiverPlaceholder(SyntaxNode syntax, BoundExpression receiver, TypeSymbol? type, bool hasErrors = false)
500public BoundCapturedReceiverPlaceholder Update(BoundExpression receiver, TypeSymbol? type)
502if (receiver != this.Receiver || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
514public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type, bool hasErrors)
524public BoundDeconstructValuePlaceholder(SyntaxNode syntax, Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type)
534public new TypeSymbol Type => base.Type!;
541public BoundDeconstructValuePlaceholder Update(Symbol? variableSymbol, bool isDiscardExpression, TypeSymbol type)
543if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variableSymbol, this.VariableSymbol) || isDiscardExpression != this.IsDiscardExpression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
555public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
563public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type)
571public new TypeSymbol Type => base.Type!;
576public BoundTupleOperandPlaceholder Update(TypeSymbol type)
578if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
590public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
595public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol? type)
600public new TypeSymbol? Type => base.Type;
605public BoundAwaitableValuePlaceholder Update(TypeSymbol? type)
607if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
619public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
627public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
635public new TypeSymbol Type => base.Type!;
640public BoundDisposableValuePlaceholder Update(TypeSymbol type)
642if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
654public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, bool isNewInstance, TypeSymbol type, bool hasErrors)
663public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, bool isNewInstance, TypeSymbol type)
672public new TypeSymbol Type => base.Type!;
678public BoundObjectOrCollectionValuePlaceholder Update(bool isNewInstance, TypeSymbol type)
680if (isNewInstance != this.IsNewInstance || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
692public BoundImplicitIndexerValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
700public BoundImplicitIndexerValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
708public new TypeSymbol Type => base.Type!;
713public BoundImplicitIndexerValuePlaceholder Update(TypeSymbol type)
715if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
727public BoundImplicitIndexerReceiverPlaceholder(SyntaxNode syntax, bool isEquivalentToThisReference, BoundExpression receiver, TypeSymbol type, bool hasErrors = false)
738public new TypeSymbol Type => base.Type!;
745public BoundImplicitIndexerReceiverPlaceholder Update(bool isEquivalentToThisReference, BoundExpression receiver, TypeSymbol type)
747if (isEquivalentToThisReference != this.IsEquivalentToThisReference || receiver != this.Receiver || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
759public BoundListPatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
767public BoundListPatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type)
775public new TypeSymbol Type => base.Type!;
780public BoundListPatternReceiverPlaceholder Update(TypeSymbol type)
782if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
794public BoundListPatternIndexPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
802public BoundListPatternIndexPlaceholder(SyntaxNode syntax, TypeSymbol type)
810public new TypeSymbol Type => base.Type!;
815public BoundListPatternIndexPlaceholder Update(TypeSymbol type)
817if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
829public BoundSlicePatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
837public BoundSlicePatternReceiverPlaceholder(SyntaxNode syntax, TypeSymbol type)
845public new TypeSymbol Type => base.Type!;
850public BoundSlicePatternReceiverPlaceholder Update(TypeSymbol type)
852if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
864public BoundSlicePatternRangePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
872public BoundSlicePatternRangePlaceholder(SyntaxNode syntax, TypeSymbol type)
880public new TypeSymbol Type => base.Type!;
885public BoundSlicePatternRangePlaceholder Update(TypeSymbol type)
887if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
899public BoundCollectionBuilderElementsPlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
904public BoundCollectionBuilderElementsPlaceholder(SyntaxNode syntax, TypeSymbol? type)
913public BoundCollectionBuilderElementsPlaceholder Update(TypeSymbol? type)
915if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
927public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type, bool hasErrors)
933public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type)
944public BoundDup Update(RefKind refKind, TypeSymbol? type)
946if (refKind != this.RefKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
958public BoundPassByCopy(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
972public BoundPassByCopy Update(BoundExpression expression, TypeSymbol? type)
974if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
986public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false)
1009public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type)
1011if (resultKind != this.ResultKind || symbols != this.Symbols || childBoundNodes != this.ChildBoundNodes || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1079public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false)
1094public new TypeSymbol Type => base.Type!;
1100public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type)
1102if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(aliasOpt, this.AliasOpt) || boundContainingTypeOpt != this.BoundContainingTypeOpt || boundDimensionsOpt != this.BoundDimensionsOpt || typeWithAnnotations != this.TypeWithAnnotations || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1114public BoundTypeOrValueExpression(SyntaxNode syntax, Binder binder, Symbol valueSymbol, TypeSymbol type, bool hasErrors)
1130public BoundTypeOrValueExpression(SyntaxNode syntax, Binder binder, Symbol valueSymbol, TypeSymbol type)
1142public new TypeSymbol Type => base.Type!;
1149public BoundTypeOrValueExpression Update(Binder binder, Symbol valueSymbol, TypeSymbol type)
1151if (binder != this.Binder || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(valueSymbol, this.ValueSymbol) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1183public new TypeSymbol? Type => base.Type;
1204public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1220public new TypeSymbol Type => base.Type!;
1225public TypeSymbol? ConstrainedToTypeOpt { get; }
1232public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1234if (operatorKind != this.OperatorKind || operand != this.Operand || constantValueOpt != this.ConstantValueOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(constrainedToTypeOpt, this.ConstrainedToTypeOpt, TypeCompareKind.ConsiderEverything) || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1246public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1265public new TypeSymbol Type => base.Type!;
1269public TypeSymbol? ConstrainedToTypeOpt { get; }
1280public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1282if (operatorKind != this.OperatorKind || operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(constrainedToTypeOpt, this.ConstrainedToTypeOpt, TypeCompareKind.ConsiderEverything) || operandPlaceholder != this.OperandPlaceholder || operandConversion != this.OperandConversion || resultPlaceholder != this.ResultPlaceholder || resultConversion != this.ResultConversion || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1294public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, bool isManaged, TypeSymbol type, bool hasErrors = false)
1305public new TypeSymbol Type => base.Type!;
1312public BoundAddressOfOperator Update(BoundExpression operand, bool isManaged, TypeSymbol type)
1314if (operand != this.Operand || isManaged != this.IsManaged || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1336public new TypeSymbol? Type => base.Type;
1355public BoundFunctionPointerLoad(SyntaxNode syntax, MethodSymbol targetMethod, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, bool hasErrors)
1366public BoundFunctionPointerLoad(SyntaxNode syntax, MethodSymbol targetMethod, TypeSymbol? constrainedToTypeOpt, TypeSymbol type)
1378public TypeSymbol? ConstrainedToTypeOpt { get; }
1379public new TypeSymbol Type => base.Type!;
1384public BoundFunctionPointerLoad Update(MethodSymbol targetMethod, TypeSymbol? constrainedToTypeOpt, TypeSymbol type)
1386if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(targetMethod, this.TargetMethod) || !TypeSymbol.Equals(constrainedToTypeOpt, this.ConstrainedToTypeOpt, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1398public BoundPointerIndirectionOperator(SyntaxNode syntax, BoundExpression operand, bool refersToLocation, TypeSymbol type, bool hasErrors = false)
1409public new TypeSymbol Type => base.Type!;
1416public BoundPointerIndirectionOperator Update(BoundExpression operand, bool refersToLocation, TypeSymbol type)
1418if (operand != this.Operand || refersToLocation != this.RefersToLocation || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1430public BoundPointerElementAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type, bool hasErrors = false)
1444public new TypeSymbol Type => base.Type!;
1453public BoundPointerElementAccess Update(BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type)
1455if (expression != this.Expression || index != this.Index || @checked != this.Checked || refersToLocation != this.RefersToLocation || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1467public BoundFunctionPointerInvocation(SyntaxNode syntax, BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
1481public new TypeSymbol Type => base.Type!;
1490public BoundFunctionPointerInvocation Update(BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type)
1492if (invokedExpression != this.InvokedExpression || arguments != this.Arguments || argumentRefKindsOpt != this.ArgumentRefKindsOpt || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1504public BoundRefTypeOperator(SyntaxNode syntax, BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false)
1515public new TypeSymbol Type => base.Type!;
1522public BoundRefTypeOperator Update(BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type)
1524if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getTypeFromHandle, this.GetTypeFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1536public BoundMakeRefOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
1546public new TypeSymbol Type => base.Type!;
1552public BoundMakeRefOperator Update(BoundExpression operand, TypeSymbol type)
1554if (operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1566public BoundRefValueOperator(SyntaxNode syntax, NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
1577public new TypeSymbol Type => base.Type!;
1584public BoundRefValueOperator Update(NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type)
1586if (nullableAnnotation != this.NullableAnnotation || operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1598public BoundFromEndIndexExpression(SyntaxNode syntax, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
1609public new TypeSymbol Type => base.Type!;
1616public BoundFromEndIndexExpression Update(BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type)
1618if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1630public BoundRangeExpression(SyntaxNode syntax, BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
1641public new TypeSymbol Type => base.Type!;
1649public BoundRangeExpression Update(BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type)
1651if (leftOperandOpt != this.LeftOperandOpt || rightOperandOpt != this.RightOperandOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1663protected BoundBinaryOperatorBase(BoundKind kind, SyntaxNode syntax, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1675public new TypeSymbol Type => base.Type!;
1682public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1706public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type)
1708if (operatorKind != this.OperatorKind || data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1720public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false)
1735public new TypeSymbol Type => base.Type!;
1744public BoundTupleBinaryOperator Update(BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type)
1746if (left != this.Left || right != this.Right || operatorKind != this.OperatorKind || operators != this.Operators || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1758public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, BoundValuePlaceholder? trueFalseOperandPlaceholder, BoundExpression? trueFalseOperandConversion, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1790public TypeSymbol? ConstrainedToTypeOpt { get; }
1797public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, BoundValuePlaceholder? trueFalseOperandPlaceholder, BoundExpression? trueFalseOperandConversion, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type)
1799if (operatorKind != this.OperatorKind || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(logicalOperator, this.LogicalOperator) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(trueOperator, this.TrueOperator) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(falseOperator, this.FalseOperator) || trueFalseOperandPlaceholder != this.TrueFalseOperandPlaceholder || trueFalseOperandConversion != this.TrueFalseOperandConversion || !TypeSymbol.Equals(constrainedToTypeOpt, this.ConstrainedToTypeOpt, TypeCompareKind.ConsiderEverything) || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1811public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1830public new TypeSymbol Type => base.Type!;
1844public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1846if (@operator != this.Operator || left != this.Left || right != this.Right || leftPlaceholder != this.LeftPlaceholder || leftConversion != this.LeftConversion || finalPlaceholder != this.FinalPlaceholder || finalConversion != this.FinalConversion || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1858public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type, bool hasErrors = false)
1870public new TypeSymbol Type => base.Type!;
1878public BoundAssignmentOperator Update(BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type)
1880if (left != this.Left || right != this.Right || isRef != this.IsRef || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1892public BoundDeconstructionAssignmentOperator(SyntaxNode syntax, BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type, bool hasErrors = false)
1905public new TypeSymbol Type => base.Type!;
1913public BoundDeconstructionAssignmentOperator Update(BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type)
1915if (left != this.Left || right != this.Right || isUsed != this.IsUsed || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1927public BoundNullCoalescingOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type, bool hasErrors = false)
1943public new TypeSymbol Type => base.Type!;
1954public BoundNullCoalescingOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type)
1956if (leftOperand != this.LeftOperand || rightOperand != this.RightOperand || leftPlaceholder != this.LeftPlaceholder || leftConversion != this.LeftConversion || operatorResultKind != this.OperatorResultKind || @checked != this.Checked || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
1968public BoundNullCoalescingAssignmentOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type, bool hasErrors = false)
1985public BoundNullCoalescingAssignmentOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type)
1987if (leftOperand != this.LeftOperand || rightOperand != this.RightOperand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2014public new TypeSymbol? Type => base.Type;
2038public BoundConditionalOperator(SyntaxNode syntax, bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
2056public new TypeSymbol Type => base.Type!;
2062public TypeSymbol? NaturalTypeOpt { get; }
2068public BoundConditionalOperator Update(bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type)
2070if (isRef != this.IsRef || condition != this.Condition || consequence != this.Consequence || alternative != this.Alternative || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(naturalTypeOpt, this.NaturalTypeOpt, TypeCompareKind.ConsiderEverything) || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2082public BoundArrayAccess(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type, bool hasErrors = false)
2094public new TypeSymbol Type => base.Type!;
2101public BoundArrayAccess Update(BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type)
2103if (expression != this.Expression || indices != this.Indices || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2124public new TypeSymbol? Type => base.Type;
2144public BoundArrayLength(SyntaxNode syntax, BoundExpression expression, TypeSymbol type, bool hasErrors = false)
2154public new TypeSymbol Type => base.Type!;
2160public BoundArrayLength Update(BoundExpression expression, TypeSymbol type)
2162if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2215public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type, bool hasErrors = false)
2228public new TypeSymbol Type => base.Type!;
2236public BoundAwaitExpression Update(BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type)
2238if (expression != this.Expression || awaitableInfo != this.AwaitableInfo || debugInfo != this.DebugInfo || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2250protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors)
2259protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type)
2268public new TypeSymbol Type => base.Type!;
2274public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false)
2289public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type)
2291if (sourceType != this.SourceType || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getTypeFromHandle, this.GetTypeFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2335public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type, bool hasErrors)
2349public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type)
2359public new TypeSymbol Type => base.Type!;
2365public BoundMethodDefIndex Update(MethodSymbol method, TypeSymbol type)
2367if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2379public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type, bool hasErrors)
2390public BoundLocalId(SyntaxNode syntax, LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type)
2401public new TypeSymbol Type => base.Type!;
2408public BoundLocalId Update(LocalSymbol local, FieldSymbol? hoistedField, TypeSymbol type)
2410if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(local, this.Local) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(hoistedField, this.HoistedField) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2422public BoundParameterId(SyntaxNode syntax, ParameterSymbol parameter, FieldSymbol? hoistedField, TypeSymbol type, bool hasErrors)
2433public BoundParameterId(SyntaxNode syntax, ParameterSymbol parameter, FieldSymbol? hoistedField, TypeSymbol type)
2444public new TypeSymbol Type => base.Type!;
2451public BoundParameterId Update(ParameterSymbol parameter, FieldSymbol? hoistedField, TypeSymbol type)
2453if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(parameter, this.Parameter) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(hoistedField, this.HoistedField) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2465public BoundStateMachineInstanceId(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2473public BoundStateMachineInstanceId(SyntaxNode syntax, TypeSymbol type)
2481public new TypeSymbol Type => base.Type!;
2486public BoundStateMachineInstanceId Update(TypeSymbol type)
2488if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2500public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2508public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type)
2516public new TypeSymbol Type => base.Type!;
2521public BoundMaximumMethodDefIndex Update(TypeSymbol type)
2523if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2535public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type, bool hasErrors)
2544public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type)
2554public new TypeSymbol Type => base.Type!;
2559public BoundInstrumentationPayloadRoot Update(int analysisKind, TypeSymbol type)
2561if (analysisKind != this.AnalysisKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2573public BoundThrowIfModuleCancellationRequested(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2581public BoundThrowIfModuleCancellationRequested(SyntaxNode syntax, TypeSymbol type)
2589public new TypeSymbol Type => base.Type!;
2594public BoundThrowIfModuleCancellationRequested Update(TypeSymbol type)
2596if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2608public ModuleCancellationTokenExpression(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2616public ModuleCancellationTokenExpression(SyntaxNode syntax, TypeSymbol type)
2624public new TypeSymbol Type => base.Type!;
2629public ModuleCancellationTokenExpression Update(TypeSymbol type)
2631if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2643public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2651public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type)
2659public new TypeSymbol Type => base.Type!;
2664public BoundModuleVersionId Update(TypeSymbol type)
2666if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2678public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
2686public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type)
2694public new TypeSymbol Type => base.Type!;
2699public BoundModuleVersionIdString Update(TypeSymbol type)
2701if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2713public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type, bool hasErrors)
2723public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type)
2733public new TypeSymbol Type => base.Type!;
2739public BoundSourceDocumentIndex Update(Cci.DebugSourceDocument document, TypeSymbol type)
2741if (document != this.Document || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2753public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type, bool hasErrors)
2764public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type)
2775public new TypeSymbol Type => base.Type!;
2782public BoundMethodInfo Update(MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type)
2784if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getMethodFromHandle, this.GetMethodFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2796public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type, bool hasErrors)
2807public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type)
2818public new TypeSymbol Type => base.Type!;
2825public BoundFieldInfo Update(FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type)
2827if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(field, this.Field) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getFieldFromHandle, this.GetFieldFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2849public new TypeSymbol? Type => base.Type;
2862public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
2872public new TypeSymbol Type => base.Type!;
2879public BoundDefaultExpression Update(BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type)
2881if (targetType != this.TargetType || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2893public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false)
2906public new TypeSymbol Type => base.Type!;
2914public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type)
2916if (operand != this.Operand || targetType != this.TargetType || conversionKind != this.ConversionKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2928public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false)
2942public new TypeSymbol Type => base.Type!;
2951public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type)
2953if (operand != this.Operand || targetType != this.TargetType || operandPlaceholder != this.OperandPlaceholder || operandConversion != this.OperandConversion || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2965public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
2976public new TypeSymbol Type => base.Type!;
2983public BoundSizeOfOperator Update(BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type)
2985if (sourceType != this.SourceType || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
2997public BoundConversion(SyntaxNode syntax, BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, InConversionGroupFlags inConversionGroupFlags, TypeSymbol type, bool hasErrors = false)
3018public new TypeSymbol Type => base.Type!;
3031public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, InConversionGroupFlags inConversionGroupFlags, TypeSymbol type)
3033if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || inConversionGroupFlags != this.InConversionGroupFlags || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
3045public BoundReadOnlySpanFromArray(SyntaxNode syntax, BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type, bool hasErrors = false)
3057public new TypeSymbol Type => base.Type!;
3064public BoundReadOnlySpanFromArray Update(BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type)
3066if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(conversionMethod, this.ConversionMethod) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
3078public BoundArgList(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
3086public BoundArgList(SyntaxNode syntax, TypeSymbol type)
3094public new TypeSymbol Type => base.Type!;
3099public BoundArgList Update(TypeSymbol type)
3101if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
3113public BoundArgListOperator(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type, bool hasErrors = false)
3123public new TypeSymbol? Type => base.Type;
3130public BoundArgListOperator Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type)
3132if (arguments != this.Arguments || argumentRefKindsOpt != this.ArgumentRefKindsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
3144public BoundFixedLocalCollectionInitializer(SyntaxNode syntax, TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type, bool hasErrors = false)
3159public new TypeSymbol Type => base.Type!;
3160public TypeSymbol ElementPointerType { get; }
3169public BoundFixedLocalCollectionInitializer Update(TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type)
3171if (!TypeSymbol.Equals(elementPointerType, this.ElementPointerType, TypeCompareKind.ConsiderEverything) || elementPointerPlaceholder != this.ElementPointerPlaceholder || elementPointerConversion != this.ElementPointerConversion || expression != this.Expression || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getPinnableOpt, this.GetPinnableOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4311public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
4329public TypeSymbol? ExceptionTypeOpt { get; }
4338public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
4340if (locals != this.Locals || exceptionSourceOpt != this.ExceptionSourceOpt || !TypeSymbol.Equals(exceptionTypeOpt, this.ExceptionTypeOpt, TypeCompareKind.ConsiderEverything) || exceptionFilterPrologueOpt != this.ExceptionFilterPrologueOpt || exceptionFilterOpt != this.ExceptionFilterOpt || body != this.Body || isSynthesizedAsyncCatchAll != this.IsSynthesizedAsyncCatchAll)
4352public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors)
4358public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type)
4369public BoundLiteral Update(ConstantValue? constantValueOpt, TypeSymbol? type)
4371if (constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4383public BoundUtf8String(SyntaxNode syntax, string value, TypeSymbol type, bool hasErrors)
4393public BoundUtf8String(SyntaxNode syntax, string value, TypeSymbol type)
4403public new TypeSymbol Type => base.Type!;
4409public BoundUtf8String Update(string value, TypeSymbol type)
4411if (value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4423public BoundThisReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
4431public BoundThisReference(SyntaxNode syntax, TypeSymbol type)
4439public new TypeSymbol Type => base.Type!;
4444public BoundThisReference Update(TypeSymbol type)
4446if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4458public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
4466public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type)
4474public new TypeSymbol Type => base.Type!;
4479public BoundPreviousSubmissionReference Update(TypeSymbol type)
4481if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4493public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
4501public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type)
4509public new TypeSymbol Type => base.Type!;
4514public BoundHostObjectMemberReference Update(TypeSymbol type)
4516if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4528public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
4533public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type)
4538public new TypeSymbol? Type => base.Type;
4543public BoundBaseReference Update(TypeSymbol? type)
4545if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4557public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type, bool hasErrors)
4570public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type)
4583public new TypeSymbol Type => base.Type!;
4592public BoundLocal Update(LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type)
4594if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(localSymbol, this.LocalSymbol) || declarationKind != this.DeclarationKind || constantValueOpt != this.ConstantValueOpt || isNullableUnknown != this.IsNullableUnknown || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4606public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type, bool hasErrors)
4618public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type)
4630public new TypeSymbol Type => base.Type!;
4637public BoundPseudoVariable Update(LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type)
4639if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(localSymbol, this.LocalSymbol) || emitExpressions != this.EmitExpressions || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4651public BoundRangeVariable(SyntaxNode syntax, RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type, bool hasErrors = false)
4663public new TypeSymbol Type => base.Type!;
4670public BoundRangeVariable Update(RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type)
4672if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(rangeVariableSymbol, this.RangeVariableSymbol) || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4684public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type, bool hasErrors)
4694public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type)
4704public new TypeSymbol Type => base.Type!;
4710public BoundParameter Update(ParameterSymbol parameterSymbol, TypeSymbol type)
4712if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(parameterSymbol, this.ParameterSymbol) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4824public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type, bool hasErrors)
4833public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type)
4847public BoundLabel Update(LabelSymbol label, TypeSymbol? type)
4849if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
4931protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
4996public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
5010public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type)
5012if (expression != this.Expression || switchArms != this.SwitchArms || reachabilityDecisionDag != this.ReachabilityDecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(defaultLabel, this.DefaultLabel) || reportedNotExhaustive != this.ReportedNotExhaustive || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5024public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false)
5037public new TypeSymbol Type => base.Type!;
5038public TypeSymbol? NaturalTypeOpt { get; }
5044public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type)
5046if (!TypeSymbol.Equals(naturalTypeOpt, this.NaturalTypeOpt, TypeCompareKind.ConsiderEverything) || wasTargetTyped != this.WasTargetTyped || expression != this.Expression || switchArms != this.SwitchArms || reachabilityDecisionDag != this.ReachabilityDecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(defaultLabel, this.DefaultLabel) || reportedNotExhaustive != this.ReportedNotExhaustive || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5253public BoundDagTemp(SyntaxNode syntax, TypeSymbol type, BoundDagEvaluation? source, int index, bool hasErrors = false)
5264public TypeSymbol Type { get; }
5271public BoundDagTemp Update(TypeSymbol type, BoundDagEvaluation? source, int index)
5273if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || source != this.Source || index != this.Index)
5285public BoundDagTypeTest(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false)
5295public TypeSymbol Type { get; }
5300public BoundDagTypeTest Update(TypeSymbol type, BoundDagTemp input)
5302if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || input != this.Input)
5469public BoundDagTypeEvaluation(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false)
5479public TypeSymbol Type { get; }
5484public BoundDagTypeEvaluation Update(TypeSymbol type, BoundDagTemp input)
5486if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || input != this.Input)
5589public BoundDagIndexerEvaluation(SyntaxNode syntax, TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false)
5612public TypeSymbol IndexerType { get; }
5622public BoundDagIndexerEvaluation Update(TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input)
5624if (!TypeSymbol.Equals(indexerType, this.IndexerType, TypeCompareKind.ConsiderEverything) || lengthTemp != this.LengthTemp || index != this.Index || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || input != this.Input)
5636public BoundDagSliceEvaluation(SyntaxNode syntax, TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false)
5660public TypeSymbol SliceType { get; }
5671public BoundDagSliceEvaluation Update(TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input)
5673if (!TypeSymbol.Equals(sliceType, this.SliceType, TypeCompareKind.ConsiderEverything) || lengthTemp != this.LengthTemp || startIndex != this.StartIndex || endIndex != this.EndIndex || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || input != this.Input)
5814public new TypeSymbol? Type => base.Type;
5821public BoundSequencePointExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
5835public BoundSequencePointExpression Update(BoundExpression expression, TypeSymbol? type)
5837if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5849public BoundSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
5863public new TypeSymbol Type => base.Type!;
5871public BoundSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type)
5873if (locals != this.Locals || sideEffects != this.SideEffects || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5885public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
5899public new TypeSymbol Type => base.Type!;
5907public BoundSpillSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type)
5909if (locals != this.Locals || sideEffects != this.SideEffects || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5921public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false)
5936public new TypeSymbol Type => base.Type!;
5946public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type)
5948if (receiver != this.Receiver || typeArgumentsOpt != this.TypeArgumentsOpt || name != this.Name || invoked != this.Invoked || indexed != this.Indexed || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
5960protected BoundDynamicInvocableBase(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol? type, bool hasErrors = false)
5977public BoundDynamicInvocation(SyntaxNode syntax, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false)
5991public new TypeSymbol Type => base.Type!;
5999public BoundDynamicInvocation Update(ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type)
6001if (argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || applicableMethods != this.ApplicableMethods || expression != this.Expression || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6013public BoundConditionalAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type, bool hasErrors = false)
6025public new TypeSymbol Type => base.Type!;
6032public BoundConditionalAccess Update(BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type)
6034if (receiver != this.Receiver || accessExpression != this.AccessExpression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6046public BoundLoweredConditionalAccess(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type, bool hasErrors = false)
6062public new TypeSymbol Type => base.Type!;
6073public BoundLoweredConditionalAccess Update(BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type)
6075if (receiver != this.Receiver || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(hasValueMethodOpt, this.HasValueMethodOpt) || whenNotNull != this.WhenNotNull || whenNullOpt != this.WhenNullOpt || id != this.Id || forceCopyOfNullableValueType != this.ForceCopyOfNullableValueType || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6087public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type, bool hasErrors)
6096public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type)
6105public new TypeSymbol Type => base.Type!;
6111public BoundConditionalReceiver Update(int id, TypeSymbol type)
6113if (id != this.Id || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6125public BoundComplexConditionalReceiver(SyntaxNode syntax, BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type, bool hasErrors = false)
6137public new TypeSymbol Type => base.Type!;
6144public BoundComplexConditionalReceiver Update(BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type)
6146if (valueTypeReceiver != this.ValueTypeReceiver || referenceTypeReceiver != this.ReferenceTypeReceiver || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6227public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type, bool hasErrors = false)
6254public new TypeSymbol Type => base.Type!;
6272public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type)
6274if (receiverOpt != this.ReceiverOpt || initialBindingReceiverIsSubjectToCloning != this.InitialBindingReceiverIsSubjectToCloning || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || isDelegateCall != this.IsDelegateCall || expanded != this.Expanded || invokedAsExtensionMethod != this.InvokedAsExtensionMethod || argsToParamsOpt != this.ArgsToParamsOpt || defaultArguments != this.DefaultArguments || resultKind != this.ResultKind || originalMethodsOpt != this.OriginalMethodsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6286public BoundEventAssignmentOperator(SyntaxNode syntax, EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type, bool hasErrors = false)
6301public new TypeSymbol Type => base.Type!;
6311public BoundEventAssignmentOperator Update(EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type)
6313if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(@event, this.Event) || isAddition != this.IsAddition || isDynamic != this.IsDynamic || receiverOpt != this.ReceiverOpt || argument != this.Argument || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6325public BoundAttribute(SyntaxNode syntax, MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
6343public new TypeSymbol Type => base.Type!;
6356public BoundAttribute Update(MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type)
6358if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(constructor, this.Constructor) || constructorArguments != this.ConstructorArguments || constructorArgumentNamesOpt != this.ConstructorArgumentNamesOpt || constructorArgumentsToParamsOpt != this.ConstructorArgumentsToParamsOpt || constructorExpanded != this.ConstructorExpanded || constructorDefaultArguments != this.ConstructorDefaultArguments || namedArguments != this.NamedArguments || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6384public new TypeSymbol? Type => base.Type;
6408protected BoundObjectCreationExpressionBase(BoundKind kind, SyntaxNode syntax, TypeSymbol type, bool hasErrors)
6416protected BoundObjectCreationExpressionBase(BoundKind kind, SyntaxNode syntax, TypeSymbol type)
6424public new TypeSymbol Type => base.Type!;
6429public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
6466public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type)
6468if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(constructor, this.Constructor) || constructorsGroup != this.ConstructorsGroup || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || defaultArguments != this.DefaultArguments || constantValueOpt != this.ConstantValueOpt || initializerExpressionOpt != this.InitializerExpressionOpt || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6480protected BoundCollectionExpressionBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundNode> elements, TypeSymbol? type, bool hasErrors = false)
6507public new TypeSymbol? Type => base.Type;
6559public BoundCollectionExpression(SyntaxNode syntax, CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type, bool hasErrors = false)
6581public new TypeSymbol Type => base.Type!;
6594public BoundCollectionExpression Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6596if (collectionTypeKind != this.CollectionTypeKind || placeholder != this.Placeholder || collectionCreation != this.CollectionCreation || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(collectionBuilderMethod, this.CollectionBuilderMethod) || collectionBuilderElementsPlaceholder != this.CollectionBuilderElementsPlaceholder || wasTargetTyped != this.WasTargetTyped || hasWithElement != this.HasWithElement || unconvertedCollectionExpression != this.UnconvertedCollectionExpression || elements != this.Elements || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6608public BoundCollectionExpressionSpreadExpressionPlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
6613public BoundCollectionExpressionSpreadExpressionPlaceholder(SyntaxNode syntax, TypeSymbol? type)
6622public BoundCollectionExpressionSpreadExpressionPlaceholder Update(TypeSymbol? type)
6624if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6676protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6694public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6702public new TypeSymbol? Type => base.Type;
6707public BoundTupleLiteral Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type)
6709if (arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || inferredNamesOpt != this.InferredNamesOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6721public BoundConvertedTupleLiteral(SyntaxNode syntax, BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6737public BoundConvertedTupleLiteral Update(BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type)
6739if (sourceTuple != this.SourceTuple || wasTargetTyped != this.WasTargetTyped || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || inferredNamesOpt != this.InferredNamesOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6751public BoundDynamicObjectCreationExpression(SyntaxNode syntax, string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
6780public BoundDynamicObjectCreationExpression Update(string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type)
6782if (name != this.Name || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || initializerExpressionOpt != this.InitializerExpressionOpt || applicableMethods != this.ApplicableMethods || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6794public BoundNoPiaObjectCreationExpression(SyntaxNode syntax, string? guidString, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
6812public BoundNoPiaObjectCreationExpression Update(string? guidString, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type)
6814if (guidString != this.GuidString || initializerExpressionOpt != this.InitializerExpressionOpt || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6826protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6838public new TypeSymbol Type => base.Type!;
6845public BoundObjectInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6859public BoundObjectInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type)
6861if (placeholder != this.Placeholder || initializers != this.Initializers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6873public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false)
6893public new TypeSymbol Type => base.Type!;
6903public TypeSymbol ReceiverType { get; }
6908public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type)
6910if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(memberSymbol, this.MemberSymbol) || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || defaultArguments != this.DefaultArguments || resultKind != this.ResultKind || accessorKind != this.AccessorKind || !TypeSymbol.Equals(receiverType, this.ReceiverType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6922public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type, bool hasErrors)
6934public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type)
6946public new TypeSymbol Type => base.Type!;
6948public TypeSymbol ReceiverType { get; }
6953public BoundDynamicObjectInitializerMember Update(string memberName, TypeSymbol receiverType, TypeSymbol type)
6955if (memberName != this.MemberName || !TypeSymbol.Equals(receiverType, this.ReceiverType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6967public BoundCollectionInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6981public BoundCollectionInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type)
6983if (placeholder != this.Placeholder || initializers != this.Initializers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
6995public BoundCollectionElementInitializer(SyntaxNode syntax, MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7013public new TypeSymbol Type => base.Type!;
7026public BoundCollectionElementInitializer Update(MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type)
7028if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(addMethod, this.AddMethod) || arguments != this.Arguments || implicitReceiverOpt != this.ImplicitReceiverOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || defaultArguments != this.DefaultArguments || invokedAsExtensionMethod != this.InvokedAsExtensionMethod || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7040public BoundDynamicCollectionElementInitializer(SyntaxNode syntax, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false)
7052public new TypeSymbol Type => base.Type!;
7058public BoundDynamicCollectionElementInitializer Update(ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type)
7060if (applicableMethods != this.ApplicableMethods || expression != this.Expression || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7072public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
7080public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type)
7088public new TypeSymbol Type => base.Type!;
7093public BoundImplicitReceiver Update(TypeSymbol type)
7095if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7107public BoundAnonymousObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type, bool hasErrors = false)
7121public new TypeSymbol Type => base.Type!;
7129public BoundAnonymousObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type)
7131if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(constructor, this.Constructor) || arguments != this.Arguments || declarations != this.Declarations || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7143public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors)
7153public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type)
7163public new TypeSymbol Type => base.Type!;
7169public BoundAnonymousPropertyDeclaration Update(PropertySymbol property, TypeSymbol type)
7171if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(property, this.Property) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7183public BoundNewT(SyntaxNode syntax, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
7199public BoundNewT Update(BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type)
7201if (initializerExpressionOpt != this.InitializerExpressionOpt || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7213public BoundDelegateCreationExpression(SyntaxNode syntax, BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
7226public new TypeSymbol Type => base.Type!;
7235public BoundDelegateCreationExpression Update(BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type)
7237if (argument != this.Argument || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || isExtensionMethod != this.IsExtensionMethod || wasTargetTyped != this.WasTargetTyped || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7249public BoundArrayCreation(SyntaxNode syntax, ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false)
7260public new TypeSymbol Type => base.Type!;
7267public BoundArrayCreation Update(ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type)
7269if (bounds != this.Bounds || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7291public new TypeSymbol? Type => base.Type;
7312protected BoundStackAllocArrayCreationBase(BoundKind kind, SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false)
7324public TypeSymbol ElementType { get; }
7331public BoundStackAllocArrayCreation(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false)
7344public BoundStackAllocArrayCreation Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type)
7346if (!TypeSymbol.Equals(elementType, this.ElementType, TypeCompareKind.ConsiderEverything) || count != this.Count || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7358public BoundConvertedStackAllocExpression(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false)
7368public new TypeSymbol Type => base.Type!;
7373public BoundConvertedStackAllocExpression Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type)
7375if (!TypeSymbol.Equals(elementType, this.ElementType, TypeCompareKind.ConsiderEverything) || count != this.Count || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7387public BoundFieldAccess(SyntaxNode syntax, BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false)
7402public new TypeSymbol Type => base.Type!;
7413public BoundFieldAccess Update(BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type)
7415if (receiverOpt != this.ReceiverOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(fieldSymbol, this.FieldSymbol) || constantValueOpt != this.ConstantValueOpt || resultKind != this.ResultKind || isByValue != this.IsByValue || isDeclaration != this.IsDeclaration || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7427public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type, bool hasErrors)
7437public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type)
7447public new TypeSymbol Type => base.Type!;
7453public BoundHoistedFieldAccess Update(FieldSymbol fieldSymbol, TypeSymbol type)
7455if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(fieldSymbol, this.FieldSymbol) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7467public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7481public new TypeSymbol Type => base.Type!;
7491public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type)
7493if (receiverOpt != this.ReceiverOpt || initialBindingReceiverIsSubjectToCloning != this.InitialBindingReceiverIsSubjectToCloning || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(propertySymbol, this.PropertySymbol) || autoPropertyAccessorKind != this.AutoPropertyAccessorKind || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7505public BoundEventAccess(SyntaxNode syntax, BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7518public new TypeSymbol Type => base.Type!;
7527public BoundEventAccess Update(BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type)
7529if (receiverOpt != this.ReceiverOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(eventSymbol, this.EventSymbol) || isUsableAsField != this.IsUsableAsField || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7541public BoundIndexerAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type, bool hasErrors = false)
7562public new TypeSymbol Type => base.Type!;
7578public BoundIndexerAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type)
7580if (receiverOpt != this.ReceiverOpt || initialBindingReceiverIsSubjectToCloning != this.InitialBindingReceiverIsSubjectToCloning || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(indexer, this.Indexer) || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || expanded != this.Expanded || accessorKind != this.AccessorKind || argsToParamsOpt != this.ArgsToParamsOpt || defaultArguments != this.DefaultArguments || originalIndexersOpt != this.OriginalIndexersOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7592public BoundImplicitIndexerAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type, bool hasErrors = false)
7616public new TypeSymbol Type => base.Type!;
7627public BoundImplicitIndexerAccess Update(BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type)
7629if (receiver != this.Receiver || argument != this.Argument || lengthOrCountAccess != this.LengthOrCountAccess || receiverPlaceholder != this.ReceiverPlaceholder || indexerOrSliceAccess != this.IndexerOrSliceAccess || argumentPlaceholders != this.ArgumentPlaceholders || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7641public BoundInlineArrayAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type, bool hasErrors = false)
7659public new TypeSymbol Type => base.Type!;
7668public BoundInlineArrayAccess Update(BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type)
7670if (expression != this.Expression || argument != this.Argument || isValue != this.IsValue || getItemOrSliceHelper != this.GetItemOrSliceHelper || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7682public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false)
7698public new TypeSymbol Type => base.Type!;
7708public BoundDynamicIndexerAccess Update(BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type)
7710if (receiver != this.Receiver || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || applicableIndexers != this.ApplicableIndexers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7722public BoundLambda(SyntaxNode syntax, UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type, bool hasErrors = false)
7740public new TypeSymbol? Type => base.Type;
7748public BoundLambda Update(UnboundLambda unboundLambda, MethodSymbol symbol, BoundBlock body, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics, Binder binder, TypeSymbol? type)
7750if (unboundLambda != this.UnboundLambda || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(symbol, this.Symbol) || body != this.Body || diagnostics != this.Diagnostics || binder != this.Binder || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7784public new TypeSymbol? Type => base.Type;
7806public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false)
7822public new TypeSymbol Type => base.Type!;
7833public BoundQueryClause Update(BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type)
7835if (value != this.Value || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(definedSymbol, this.DefinedSymbol) || operation != this.Operation || cast != this.Cast || binder != this.Binder || unoptimizedForm != this.UnoptimizedForm || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7873public BoundNameOfOperator(SyntaxNode syntax, BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type, bool hasErrors = false)
7889public new TypeSymbol Type => base.Type!;
7896public BoundNameOfOperator Update(BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type)
7898if (argument != this.Argument || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7910protected BoundInterpolatedStringBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7926public BoundUnconvertedInterpolatedString(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7938public BoundUnconvertedInterpolatedString Update(ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type)
7940if (parts != this.Parts || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7952public BoundInterpolatedString(SyntaxNode syntax, InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7966public BoundInterpolatedString Update(InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type)
7968if (!interpolationData.Equals(this.InterpolationData) || parts != this.Parts || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
7980public BoundInterpolatedStringHandlerPlaceholder(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
7985public BoundInterpolatedStringHandlerPlaceholder(SyntaxNode syntax, TypeSymbol? type)
7994public BoundInterpolatedStringHandlerPlaceholder Update(TypeSymbol? type)
7996if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8008public BoundInterpolatedStringArgumentPlaceholder(SyntaxNode syntax, int argumentIndex, TypeSymbol type, bool hasErrors)
8017public BoundInterpolatedStringArgumentPlaceholder(SyntaxNode syntax, int argumentIndex, TypeSymbol type)
8026public new TypeSymbol Type => base.Type!;
8032public BoundInterpolatedStringArgumentPlaceholder Update(int argumentIndex, TypeSymbol type)
8034if (argumentIndex != this.ArgumentIndex || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8058public new TypeSymbol? Type => base.Type;
8081public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false)
8111public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type)
8113if (expression != this.Expression || pattern != this.Pattern || hasUnionMatching != this.HasUnionMatching || isNegated != this.IsNegated || reachabilityDecisionDag != this.ReachabilityDecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenTrueLabel, this.WhenTrueLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(whenFalseLabel, this.WhenFalseLabel) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8125protected BoundPattern(BoundKind kind, SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors)
8140protected BoundPattern(BoundKind kind, SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType)
8151public TypeSymbol InputType { get; }
8152public TypeSymbol NarrowedType { get; }
8157public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8182public BoundConstantPattern Update(BoundExpression value, ConstantValue constantValue, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8184if (value != this.Value || constantValue != this.ConstantValue || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8196public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8216public TypeSymbol UnionMatchingInputType { get; }
8224public BoundPatternWithUnionMatching Update(TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType)
8226if (!TypeSymbol.Equals(unionMatchingInputType, this.UnionMatchingInputType, TypeCompareKind.ConsiderEverything) || leftOfPendingConjunction != this.LeftOfPendingConjunction || valueProperty != this.ValueProperty || valuePattern != this.ValuePattern || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8238public BoundDiscardPattern(SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors)
8251public BoundDiscardPattern(SyntaxNode syntax, TypeSymbol inputType, TypeSymbol narrowedType)
8264public BoundDiscardPattern Update(TypeSymbol inputType, TypeSymbol narrowedType)
8266if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8278protected BoundObjectPattern(BoundKind kind, SyntaxNode syntax, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8297public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8319public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8321if (declaredType != this.DeclaredType || isVar != this.IsVar || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8333public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8360public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8362if (declaredType != this.DeclaredType || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(deconstructMethod, this.DeconstructMethod) || deconstruction != this.Deconstruction || properties != this.Properties || isExplicitNotNullTest != this.IsExplicitNotNullTest || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8374public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8404public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8406if (subpatterns != this.Subpatterns || hasSlice != this.HasSlice || lengthAccess != this.LengthAccess || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8418public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8443public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType)
8445if (pattern != this.Pattern || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8457public BoundITuplePattern(SyntaxNode syntax, MethodSymbol getLengthMethod, MethodSymbol getItemMethod, ImmutableArray<BoundPositionalSubpattern> subpatterns, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8485public BoundITuplePattern Update(MethodSymbol getLengthMethod, MethodSymbol getItemMethod, ImmutableArray<BoundPositionalSubpattern> subpatterns, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8487if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getLengthMethod, this.GetLengthMethod) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getItemMethod, this.GetItemMethod) || subpatterns != this.Subpatterns || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8575public BoundPropertySubpatternMember(SyntaxNode syntax, BoundPropertySubpatternMember? receiver, Symbol? symbol, TypeSymbol type, bool hasErrors = false)
8588public TypeSymbol Type { get; }
8593public BoundPropertySubpatternMember Update(BoundPropertySubpatternMember? receiver, Symbol? symbol, TypeSymbol type)
8595if (receiver != this.Receiver || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(symbol, this.Symbol) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8607public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8631public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8633if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8645public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8670public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType)
8672if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8684public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8704public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType)
8706if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8718public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8745public BoundRelationalPattern Update(BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType)
8747if (relation != this.Relation || value != this.Value || constantValue != this.ConstantValue || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything))
8759public BoundDiscardExpression(SyntaxNode syntax, NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type, bool hasErrors)
8766public BoundDiscardExpression(SyntaxNode syntax, NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type)
8773public new TypeSymbol? Type => base.Type;
8780public BoundDiscardExpression Update(NullableAnnotation nullableAnnotation, bool isInferred, TypeSymbol? type)
8782if (nullableAnnotation != this.NullableAnnotation || isInferred != this.IsInferred || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8794public BoundThrowExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
8808public BoundThrowExpression Update(BoundExpression expression, TypeSymbol? type)
8810if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
8832public new TypeSymbol? Type => base.Type;
8905public new TypeSymbol? Type => base.Type;
8992public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type, bool hasErrors = false)
9003public new TypeSymbol? Type => base.Type;
9009public BoundExpressionWithNullability Update(BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type)
9011if (expression != this.Expression || nullableAnnotation != this.NullableAnnotation || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
9023public BoundValueForNullableAnalysis(SyntaxNode syntax, BoundExpression? originalExpression, TypeSymbol? type, bool hasErrors = false)
9034public BoundValueForNullableAnalysis Update(BoundExpression? originalExpression, TypeSymbol? type)
9036if (originalExpression != this.OriginalExpression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
9048public BoundWithExpression(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type, bool hasErrors = false)
9061public new TypeSymbol Type => base.Type!;
9069public BoundWithExpression Update(BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type)
9071if (receiver != this.Receiver || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(cloneMethod, this.CloneMethod) || initializerExpression != this.InitializerExpression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
11134TypeSymbol? type = this.VisitType(node.Type);
11140TypeSymbol? type = this.VisitType(node.Type);
11146TypeSymbol? type = this.VisitType(node.Type);
11151TypeSymbol? type = this.VisitType(node.Type);
11156TypeSymbol? type = this.VisitType(node.Type);
11161TypeSymbol? type = this.VisitType(node.Type);
11166TypeSymbol? type = this.VisitType(node.Type);
11171TypeSymbol? type = this.VisitType(node.Type);
11177TypeSymbol? type = this.VisitType(node.Type);
11182TypeSymbol? type = this.VisitType(node.Type);
11187TypeSymbol? type = this.VisitType(node.Type);
11192TypeSymbol? type = this.VisitType(node.Type);
11197TypeSymbol? type = this.VisitType(node.Type);
11202TypeSymbol? type = this.VisitType(node.Type);
11207TypeSymbol? type = this.VisitType(node.Type);
11213TypeSymbol? type = this.VisitType(node.Type);
11220TypeSymbol? type = this.VisitType(node.Type);
11238TypeSymbol? type = this.VisitType(node.Type);
11244TypeSymbol? type = this.VisitType(node.Type);
11251TypeSymbol? type = this.VisitType(node.Type);
11259TypeSymbol? constrainedToTypeOpt = this.VisitType(node.ConstrainedToTypeOpt);
11260TypeSymbol? type = this.VisitType(node.Type);
11272TypeSymbol? constrainedToTypeOpt = this.VisitType(node.ConstrainedToTypeOpt);
11273TypeSymbol? type = this.VisitType(node.Type);
11279TypeSymbol? type = this.VisitType(node.Type);
11285TypeSymbol? type = this.VisitType(node.Type);
11291TypeSymbol? constrainedToTypeOpt = this.VisitType(node.ConstrainedToTypeOpt);
11292TypeSymbol? type = this.VisitType(node.Type);
11298TypeSymbol? type = this.VisitType(node.Type);
11305TypeSymbol? type = this.VisitType(node.Type);
11312TypeSymbol? type = this.VisitType(node.Type);
11319TypeSymbol? type = this.VisitType(node.Type);
11325TypeSymbol? type = this.VisitType(node.Type);
11331TypeSymbol? type = this.VisitType(node.Type);
11338TypeSymbol? type = this.VisitType(node.Type);
11346TypeSymbol? type = this.VisitType(node.Type);
11353TypeSymbol? type = this.VisitType(node.Type);
11360TypeSymbol? type = this.VisitType(node.Type);
11373TypeSymbol? constrainedToTypeOpt = this.VisitType(node.ConstrainedToTypeOpt);
11374TypeSymbol? type = this.VisitType(node.Type);
11386TypeSymbol? type = this.VisitType(node.Type);
11393TypeSymbol? type = this.VisitType(node.Type);
11400TypeSymbol? type = this.VisitType(node.Type);
11409TypeSymbol? type = this.VisitType(node.Type);
11416TypeSymbol? type = this.VisitType(node.Type);
11424TypeSymbol? type = this.VisitType(node.Type);
11432TypeSymbol? naturalTypeOpt = this.VisitType(node.NaturalTypeOpt);
11433TypeSymbol? type = this.VisitType(node.Type);
11440TypeSymbol? type = this.VisitType(node.Type);
11446TypeSymbol? type = this.VisitType(node.Type);
11452TypeSymbol? type = this.VisitType(node.Type);
11469TypeSymbol? type = this.VisitType(node.Type);
11476TypeSymbol? type = this.VisitType(node.Type);
11489TypeSymbol? type = this.VisitType(node.Type);
11496TypeSymbol? type = this.VisitType(node.Type);
11503TypeSymbol? type = this.VisitType(node.Type);
11508TypeSymbol? type = this.VisitType(node.Type);
11513TypeSymbol? type = this.VisitType(node.Type);
11518TypeSymbol? type = this.VisitType(node.Type);
11523TypeSymbol? type = this.VisitType(node.Type);
11528TypeSymbol? type = this.VisitType(node.Type);
11533TypeSymbol? type = this.VisitType(node.Type);
11538TypeSymbol? type = this.VisitType(node.Type);
11543TypeSymbol? type = this.VisitType(node.Type);
11550TypeSymbol? type = this.VisitType(node.Type);
11557TypeSymbol? type = this.VisitType(node.Type);
11562TypeSymbol? type = this.VisitType(node.Type);
11568TypeSymbol? type = this.VisitType(node.Type);
11575TypeSymbol? type = this.VisitType(node.Type);
11584TypeSymbol? type = this.VisitType(node.Type);
11590TypeSymbol? type = this.VisitType(node.Type);
11596TypeSymbol? type = this.VisitType(node.Type);
11603TypeSymbol? type = this.VisitType(node.Type);
11608TypeSymbol? type = this.VisitType(node.Type);
11614TypeSymbol? type = this.VisitType(node.Type);
11623TypeSymbol? elementPointerType = this.VisitType(node.ElementPointerType);
11624TypeSymbol? type = this.VisitType(node.Type);
11829TypeSymbol? exceptionTypeOpt = this.VisitType(node.ExceptionTypeOpt);
11834TypeSymbol? type = this.VisitType(node.Type);
11839TypeSymbol? type = this.VisitType(node.Type);
11844TypeSymbol? type = this.VisitType(node.Type);
11849TypeSymbol? type = this.VisitType(node.Type);
11854TypeSymbol? type = this.VisitType(node.Type);
11859TypeSymbol? type = this.VisitType(node.Type);
11865TypeSymbol? type = this.VisitType(node.Type);
11871TypeSymbol? type = this.VisitType(node.Type);
11878TypeSymbol? type = this.VisitType(node.Type);
11884TypeSymbol? type = this.VisitType(node.Type);
11908TypeSymbol? type = this.VisitType(node.Type);
11937TypeSymbol? type = this.VisitType(node.Type);
11946TypeSymbol? naturalTypeOpt = this.VisitType(node.NaturalTypeOpt);
11947TypeSymbol? type = this.VisitType(node.Type);
11983TypeSymbol? type = this.VisitType(node.Type);
11989TypeSymbol? type = this.VisitType(node.Type);
12021TypeSymbol? type = this.VisitType(node.Type);
12049TypeSymbol? indexerType = this.VisitType(node.IndexerType);
12059TypeSymbol? sliceType = this.VisitType(node.SliceType);
12090TypeSymbol? type = this.VisitType(node.Type);
12098TypeSymbol? type = this.VisitType(node.Type);
12106TypeSymbol? type = this.VisitType(node.Type);
12112TypeSymbol? type = this.VisitType(node.Type);
12120TypeSymbol? type = this.VisitType(node.Type);
12127TypeSymbol? type = this.VisitType(node.Type);
12136TypeSymbol? type = this.VisitType(node.Type);
12141TypeSymbol? type = this.VisitType(node.Type);
12148TypeSymbol? type = this.VisitType(node.Type);
12157TypeSymbol? type = this.VisitType(node.Type);
12164TypeSymbol? type = this.VisitType(node.Type);
12173TypeSymbol? type = this.VisitType(node.Type);
12181TypeSymbol? type = this.VisitType(node.Type);
12189TypeSymbol? type = this.VisitType(node.Type);
12195TypeSymbol? type = this.VisitType(node.Type);
12204TypeSymbol? type = this.VisitType(node.Type);
12211TypeSymbol? type = this.VisitType(node.Type);
12227TypeSymbol? type = this.VisitType(node.Type);
12232TypeSymbol? type = this.VisitType(node.Type);
12248TypeSymbol? type = this.VisitType(node.Type);
12255TypeSymbol? type = this.VisitType(node.Type);
12263TypeSymbol? type = this.VisitType(node.Type);
12269TypeSymbol? type = this.VisitType(node.Type);
12276TypeSymbol? type = this.VisitType(node.Type);
12283TypeSymbol? receiverType = this.VisitType(node.ReceiverType);
12284TypeSymbol? type = this.VisitType(node.Type);
12289TypeSymbol? receiverType = this.VisitType(node.ReceiverType);
12290TypeSymbol? type = this.VisitType(node.Type);
12297TypeSymbol? type = this.VisitType(node.Type);
12305TypeSymbol? type = this.VisitType(node.Type);
12313TypeSymbol? type = this.VisitType(node.Type);
12318TypeSymbol? type = this.VisitType(node.Type);
12326TypeSymbol? type = this.VisitType(node.Type);
12332TypeSymbol? type = this.VisitType(node.Type);
12338TypeSymbol? type = this.VisitType(node.Type);
12345TypeSymbol? type = this.VisitType(node.Type);
12352TypeSymbol? type = this.VisitType(node.Type);
12358TypeSymbol? type = this.VisitType(node.Type);
12365TypeSymbol? elementType = this.VisitType(node.ElementType);
12366TypeSymbol? type = this.VisitType(node.Type);
12373TypeSymbol? elementType = this.VisitType(node.ElementType);
12374TypeSymbol? type = this.VisitType(node.Type);
12381TypeSymbol? type = this.VisitType(node.Type);
12387TypeSymbol? type = this.VisitType(node.Type);
12394TypeSymbol? type = this.VisitType(node.Type);
12401TypeSymbol? type = this.VisitType(node.Type);
12410TypeSymbol? type = this.VisitType(node.Type);
12421TypeSymbol? type = this.VisitType(node.Type);
12428TypeSymbol? type = this.VisitType(node.Type);
12436TypeSymbol? type = this.VisitType(node.Type);
12444TypeSymbol? type = this.VisitType(node.Type);
12450TypeSymbol? type = this.VisitType(node.Type);
12460TypeSymbol? type = this.VisitType(node.Type);
12471TypeSymbol? type = this.VisitType(node.Type);
12477TypeSymbol? type = this.VisitType(node.Type);
12483TypeSymbol? type = this.VisitType(node.Type);
12488TypeSymbol? type = this.VisitType(node.Type);
12493TypeSymbol? type = this.VisitType(node.Type);
12501TypeSymbol? type = this.VisitType(node.Type);
12511TypeSymbol? type = this.VisitType(node.Type);
12517TypeSymbol? inputType = this.VisitType(node.InputType);
12518TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12526TypeSymbol? unionMatchingInputType = this.VisitType(node.UnionMatchingInputType);
12527TypeSymbol? inputType = this.VisitType(node.InputType);
12528TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12533TypeSymbol? inputType = this.VisitType(node.InputType);
12534TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12542TypeSymbol? inputType = this.VisitType(node.InputType);
12543TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12554TypeSymbol? inputType = this.VisitType(node.InputType);
12555TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12567TypeSymbol? inputType = this.VisitType(node.InputType);
12568TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12577TypeSymbol? inputType = this.VisitType(node.InputType);
12578TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12586TypeSymbol? inputType = this.VisitType(node.InputType);
12587TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12606TypeSymbol? type = this.VisitType(node.Type);
12612TypeSymbol? inputType = this.VisitType(node.InputType);
12613TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12620TypeSymbol? inputType = this.VisitType(node.InputType);
12621TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12627TypeSymbol? inputType = this.VisitType(node.InputType);
12628TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12634TypeSymbol? inputType = this.VisitType(node.InputType);
12635TypeSymbol? narrowedType = this.VisitType(node.NarrowedType);
12640TypeSymbol? type = this.VisitType(node.Type);
12646TypeSymbol? type = this.VisitType(node.Type);
12653TypeSymbol? type = this.VisitType(node.Type);
12660TypeSymbol? type = this.VisitType(node.Type);
12666TypeSymbol? type = this.VisitType(node.Type);
12686TypeSymbol? type = this.VisitType(node.Type);
12692TypeSymbol? type = this.VisitType(node.Type);
12700TypeSymbol? type = this.VisitType(node.Type);
12707private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _updatedNullabilities;
12711public NullabilityRewriter(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> updatedNullabilities, NullableWalker.SnapshotManager? snapshotManager, ImmutableDictionary<Symbol, Symbol>.Builder remappedSymbols)
12744if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12759if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12776if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12790if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12802if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12814if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12826if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12838if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12853if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12867if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12879if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12891if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12903if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12915if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12927if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12942if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12960if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12978if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
12995if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13009if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13022TypeSymbol? constrainedToTypeOpt = GetUpdatedSymbol(node, node.ConstrainedToTypeOpt);
13027if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13042TypeSymbol? constrainedToTypeOpt = GetUpdatedSymbol(node, node.ConstrainedToTypeOpt);
13051if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13068if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13085if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13100TypeSymbol? constrainedToTypeOpt = GetUpdatedSymbol(node, node.ConstrainedToTypeOpt);
13103if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13120if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13138if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13156if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13174if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13191if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13208if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13226if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13245if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13263if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13281if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13299if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13319if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13337if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13356if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13370TypeSymbol? naturalTypeOpt = GetUpdatedSymbol(node, node.NaturalTypeOpt);
13376if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13394if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13411if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13428if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13457if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13475if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13500if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13518if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13536if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13550if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13562if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13574if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13586if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13598if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13610if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13622if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13634if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13650if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13668if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13682if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13697if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13715if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13735if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13752if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13769if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13787if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13801if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13816if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13830TypeSymbol elementPointerType = GetUpdatedSymbol(node, node.ElementPointerType);
13837if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13961TypeSymbol? exceptionTypeOpt = GetUpdatedSymbol(node, node.ExceptionTypeOpt);
13971if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13983if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
13995if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14007if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14019if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14031if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14046if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14063if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14081if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14098if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14112if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14138if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14152TypeSymbol? naturalTypeOpt = GetUpdatedSymbol(node, node.NaturalTypeOpt);
14158if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14200TypeSymbol indexerType = GetUpdatedSymbol(node, node.IndexerType);
14211TypeSymbol sliceType = GetUpdatedSymbol(node, node.SliceType);
14233if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14252if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14271if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14288if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14307if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14325if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14345if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14359if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14375if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14395if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14413if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14433if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14452if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14471if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14488if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14508if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14526if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14548if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14562if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14577if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14595if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14614if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14631if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14649if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14664TypeSymbol receiverType = GetUpdatedSymbol(node, node.ReceiverType);
14668if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14682TypeSymbol receiverType = GetUpdatedSymbol(node, node.ReceiverType);
14685if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14703if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14722if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14741if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14755if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14772if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14789if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14806if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14824if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14842if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14859if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14873TypeSymbol elementType = GetUpdatedSymbol(node, node.ElementType);
14878if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14892TypeSymbol elementType = GetUpdatedSymbol(node, node.ElementType);
14897if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14915if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14932if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14950if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14968if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
14988if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15006if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15025if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15044if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15061if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15082if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15099if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15116if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15133if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15147if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15159if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15176if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15195if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15209TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15210TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15217TypeSymbol unionMatchingInputType = GetUpdatedSymbol(node, node.UnionMatchingInputType);
15218TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15219TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15228TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15229TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15236TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15237TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15247TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15248TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15259TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15260TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15272TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15273TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15285TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15286TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15307TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15308TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15315TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15316TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15323TypeSymbol inputType = GetUpdatedSymbol(node, node.InputType);
15324TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType);
15331if (!_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15346if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15364if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15382if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15399if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15425if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15442if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
15461if (_updatedNullabilities.TryGetValue(node, out (NullabilityInfo Info, TypeSymbol? Type) infoAndType))
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (10)
61private readonly Dictionary<TypeSymbol, FieldSymbol> _awaiterFields;
100_awaiterFields = new Dictionary<TypeSymbol, FieldSymbol>(Symbols.SymbolEqualityComparer.IgnoringDynamicTupleNamesAndNullability);
108private FieldSymbol GetAwaiterField(TypeSymbol awaiterType)
368TypeSymbol type = VisitType(node.Type);
472TypeSymbol awaiterFieldType = awaiterTemp.Type.IsVerifierReference()
492if (!TypeSymbol.Equals(awaiterFieldType, awaiterTemp.Type, TypeCompareKind.ConsiderEverything2))
494Debug.Assert(awaiterFieldType.IsObjectType() || TypeSymbol.Equals(awaiterFieldType, awaiterTempRef.Type, TypeCompareKind.AllIgnoreOptions));
534if (!TypeSymbol.Equals(awaiterTemp.Type, awaiterField.Type, TypeCompareKind.ConsiderEverything2))
536Debug.Assert(awaiterFieldRef.Type.IsObjectType() || TypeSymbol.Equals(awaiterTemp.Type, awaiterFieldRef.Type, TypeCompareKind.AllIgnoreOptions));
637private BoundStatement GenerateAwaitOnCompleted(TypeSymbol loweredAwaiterType, LocalSymbol awaiterTemp)
Lowering\ClosureConversion\ClosureConversion.cs (14)
247Debug.Assert(thisParameter is null || TypeSymbol.Equals(thisParameter.Type, thisType, TypeCompareKind.ConsiderEverything2));
595Debug.Assert(TypeSymbol.Equals(result.Type, frameType, TypeCompareKind.ConsiderEverything2));
612if ((object)_currentFrameThis != null && TypeSymbol.Equals(_currentFrameThis.Type, frameClass, TypeCompareKind.ConsiderEverything2))
625if (TypeSymbol.Equals(potentialParameter.Type.OriginalDefinition, frameClass, TypeCompareKind.ConsiderEverything2))
692Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2));
864return (!_currentMethod.IsStatic && TypeSymbol.Equals(_currentMethod.ContainingType, _topLevelMethod.ContainingType, TypeCompareKind.ConsiderEverything2))
871TypeSymbol type = VisitType(node.Type);
1009while (!TypeSymbol.Equals(oldTypeArg.Type, newTypeArg.Type, TypeCompareKind.ConsiderEverything));
1090var type = VisitType(node.Type);
1160var newType = this.VisitType(node.Type);
1288var exceptionTypeOpt = this.VisitType(node.ExceptionTypeOpt);
1639var newType = VisitType(node.Type);
1669TypeSymbol type = this.VisitType(node.Type);
1708var cacheVariableType = containerAsFrame.TypeMap.SubstituteType(node.Type).Type;
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (30)
305if (!TypeSymbol.Equals(index.Type, _int32Type, TypeCompareKind.ConsiderEverything2))
323if (!TypeSymbol.Equals(index.Type, _int32Type, TypeCompareKind.ConsiderEverything2))
494private BoundExpression VisitBinaryOperator(BinaryOperatorKind opKind, MethodSymbol methodOpt, TypeSymbol type, BoundExpression left, BoundExpression right)
517var promotedType = PromotedType(enumOperand.Type.StrippedType().GetEnumUnderlyingType());
555private BoundExpression VisitAndPromoteEnumOperand(BoundExpression operand, TypeSymbol promotedType, bool isChecked)
574private BoundExpression MakeBinary(MethodSymbol methodOpt, TypeSymbol type, bool isLifted, bool requiresLifted, WellKnownMember opFactory, BoundExpression loweredLeft, BoundExpression loweredRight)
580_bound.Literal(isLifted && !TypeSymbol.Equals(methodOpt.ReturnType, type, TypeCompareKind.ConsiderEverything2)),
586private TypeSymbol PromotedType(TypeSymbol underlying)
605private BoundExpression Demote(BoundExpression node, TypeSymbol type, bool isChecked)
615var promotedType = e.IsNullableType() ? _nullableType.Construct(PromotedType(e.GetNullableUnderlyingType())) : PromotedType(e);
616if (!TypeSymbol.Equals(promotedType, type, TypeCompareKind.ConsiderEverything2))
625private BoundExpression ConvertIndex(BoundExpression expr, TypeSymbol oldType, TypeSymbol newType)
710var operandType = node.Operand.Type;
711var strippedOperandType = operandType.StrippedType();
712var conversionInputType = method.Parameters[0].Type;
713var isLifted = !TypeSymbol.Equals(operandType, conversionInputType, TypeCompareKind.ConsiderEverything2) && TypeSymbol.Equals(strippedOperandType, conversionInputType, TypeCompareKind.ConsiderEverything2);
715!TypeSymbol.Equals(strippedOperandType, ((node.ConversionKind == ConversionKind.ExplicitUserDefined) ? conversionInputType : conversionInputType.StrippedType()), TypeCompareKind.ConsiderEverything2);
716var resultType = (isLifted && method.ReturnType.IsNonNullableValueType() && node.Type.IsNullableType()) ?
743var intermediate = nullable.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
754private BoundExpression Convert(BoundExpression operand, TypeSymbol oldType, TypeSymbol newType, bool isChecked, bool isExplicit)
756return (TypeSymbol.Equals(oldType, newType, TypeCompareKind.ConsiderEverything2) && !isExplicit) ? operand : Convert(operand, newType, isChecked);
759private BoundExpression Convert(BoundExpression expr, TypeSymbol type, bool isChecked)
767private BoundExpression DelegateCreation(BoundExpression receiver, MethodSymbol method, TypeSymbol delegateType, bool requiresInstanceReceiver)
876ImmutableArray.Create<TypeSymbol>(underlyingDelegateType),
910var fromType = leftPlaceholder.Type;
1240var promotedType = PromotedType(arg.Type.StrippedType().GetEnumUnderlyingType());
Lowering\DiagnosticsPass_Warnings.cs (12)
116TypeSymbol baseType = fieldAccess.FieldSymbol.ContainingType;
119if (TypeSymbol.Equals(baseType, marshalByRefType, TypeCompareKind.ConsiderEverything))
154if ((object)interlocked != null && TypeSymbol.Equals(interlocked, method.ContainingType, TypeCompareKind.ConsiderEverything2))
228Debug.Assert(TypeSymbol.Equals(expr1.Type, expr2.Type, TypeCompareKind.ConsiderEverything2));
328TypeSymbol t;
349private static bool ConvertedHasEqual(BinaryOperatorKind oldOperatorKind, BoundNode node, out TypeSymbol type)
369if (parameters.Length == 2 && TypeSymbol.Equals(parameters[0].Type, t, TypeCompareKind.ConsiderEverything2) && TypeSymbol.Equals(parameters[1].Type, t, TypeCompareKind.ConsiderEverything2))
611TypeSymbol from = conv.Operand.Type;
612TypeSymbol to = conv.Type;
850private static TypeSymbol GetTypeForLiftedComparisonWarning(BoundExpression node)
862TypeSymbol type = null;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (10)
128private readonly TypeSymbol _contextType;
132TypeSymbol contextType,
204private MethodSymbol? GetLocalOrParameterStoreLogger(TypeSymbol variableType, Symbol targetSymbol, bool? refAssignmentSourceIsLocal, SyntaxNode syntax)
249static bool hasOverriddenToString(TypeSymbol variableType)
394if (!TryGetLocalOrParameterInfo(original.Left, out var targetSymbol, out var targetType, out var targetIndex))
415private bool TryGetLocalOrParameterInfo(BoundNode node, [NotNullWhen(true)] out Symbol? symbol, [NotNullWhen(true)] out TypeSymbol? type, [NotNullWhen(true)] out BoundExpression? indexExpression)
444TypeSymbol targetType,
508ref TypeSymbol? rewrittenType,
531var targetType = targetSymbol.Type;
606if (!TryGetLocalOrParameterInfo(arguments[i], out var targetSymbol, out var targetType, out var targetIndex))
Lowering\LocalRewriter\DelegateCacheContainer.cs (13)
19private readonly Dictionary<(TypeSymbol?, TypeSymbol, MethodSymbol), FieldSymbol> _delegateFields = new(CLRSignatureComparer.Instance);
63var delegateType = boundDelegateCreation.Type;
68var constrainedToTypeOpt = ((targetMethod.IsAbstract || targetMethod.IsVirtual) && boundDelegateCreation.Argument is BoundTypeExpression typeExpression) ? typeExpression.Type : null;
75var fieldType = TypeParameters.IsEmpty ? delegateType : TypeMap.SubstituteType(delegateType).Type;
93private sealed class CLRSignatureComparer : IEqualityComparer<(TypeSymbol? constrainedToTypeOpt, TypeSymbol delegateType, MethodSymbol targetMethod)>
97public bool Equals((TypeSymbol? constrainedToTypeOpt, TypeSymbol delegateType, MethodSymbol targetMethod) x, (TypeSymbol? constrainedToTypeOpt, TypeSymbol delegateType, MethodSymbol targetMethod) y)
106public int GetHashCode((TypeSymbol? constrainedToTypeOpt, TypeSymbol delegateType, MethodSymbol targetMethod) conversion)
Lowering\LocalRewriter\LocalRewriter.cs (12)
73Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2));
264TypeSymbol? type = node.Type;
591private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child)
596private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child1, BoundExpression child2)
601private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, ImmutableArray<BoundExpression> children)
640TypeSymbol container = compilation.Assembly.GetSpecialType(type);
641TypeSymbol returnType = new ExtendedErrorTypeSymbol(compilation: compilation, name: descriptor.Name, errorInfo: null, arity: descriptor.Arity);
659TypeSymbol.Equals(node.Type, _compilation.GetWellKnownType(WellKnownType.System_Type), TypeCompareKind.AllIgnoreOptions));
664var type = this.VisitType(node.Type);
685Debug.Assert(TypeSymbol.Equals(type, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions));
694var type = this.VisitType(node.Type);
841var indexType = VisitType(node.Indices[0].Type);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (61)
73var type = node.Type;
186TypeSymbol type,
188TypeSymbol? constrainedToTypeOpt,
202TypeSymbol type,
204TypeSymbol? constrainedToTypeOpt,
545private BoundExpression RewriteLiftedBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt)
609TypeSymbol? constrainedToTypeOpt,
610TypeSymbol type,
733private BoundExpression MakeTruthTestForDynamicLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, TypeSymbol boolean, MethodSymbol? leftTruthOperator, TypeSymbol? constrainedToTypeOpt, bool negative)
770var parameterType = leftTruthOperator.Parameters[0].Type;
791TypeSymbol type,
793TypeSymbol? constrainedToTypeOpt)
804Debug.Assert(TypeSymbol.Equals(method.ReturnType, type, TypeCompareKind.ConsiderEverything2));
820TypeSymbol? constrainedToTypeOpt)
831TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1016TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1150TypeSymbol? constrainedToTypeOpt)
1243TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1317TypeSymbol type,
1319TypeSymbol? constrainedToTypeOpt)
1357TypeSymbol type,
1359TypeSymbol? constrainedToTypeOpt)
1382TypeSymbol type)
1426TypeSymbol type,
1428TypeSymbol? constrainedToTypeOpt)
1476TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1528TypeSymbol type,
1530TypeSymbol? constrainedToTypeOpt)
1633Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
1634Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
1635Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
1661TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1853TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1913private MethodSymbol UnsafeGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member)
1923internal static MethodSymbol UnsafeGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member, CSharpCompilation compilation, BindingDiagnosticBag diagnostics)
1930private bool TryGetNullableMethod(SyntaxNode syntax, TypeSymbol nullableType, SpecialMember member, out MethodSymbol result, bool isOptional = false)
1947TypeSymbol returnType)
2014private BoundExpression RewriteStringEquality(BoundBinaryOperator? oldNode, SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member)
2027private BoundExpression RewriteDelegateOperation(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member)
2093TypeSymbol? exprType = rewrittenExpr.Type;
2102TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
2116TypeSymbol objectType = _compilation.GetSpecialType(SpecialType.System_Object);
2151TypeSymbol type,
2157TypeSymbol rightType = loweredRight.Type;
2213TypeSymbol type)
2224TypeSymbol leftType = loweredLeft.Type;
2229TypeSymbol rightType = loweredRight.Type;
2273TypeSymbol returnType,
2394TypeSymbol multiplicationResultType;
2395TypeSymbol convertedMultiplicationResultType;
2400TypeSymbol nativeIntType = _factory.SpecialType(SpecialType.System_IntPtr);
2414TypeSymbol longType = _factory.SpecialType(SpecialType.System_Int64);
2415TypeSymbol nativeIntType = _factory.SpecialType(SpecialType.System_IntPtr);
2427TypeSymbol longType = _factory.SpecialType(SpecialType.System_Int64);
2428TypeSymbol nativeIntType = _factory.SpecialType(SpecialType.System_IntPtr);
2439TypeSymbol ulongType = _factory.SpecialType(SpecialType.System_UInt64);
2440TypeSymbol nativeUIntType = _factory.SpecialType(SpecialType.System_UIntPtr);
2460return TypeSymbol.Equals(convertedMultiplicationResultType, multiplicationResultType, TypeCompareKind.ConsiderEverything2)
2469TypeSymbol returnType)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (17)
40var collectionTypeKind = conversion.GetCollectionExpressionTypeKind(out var elementType, out _, out _);
200private bool ShouldUseIEnumerableBulkAddMethod(TypeSymbol spreadType, TypeSymbol targetEnumerableType, MethodSymbol? getEnumeratorMethod)
250private BoundExpression VisitArrayOrSpanCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType)
380static void assertTypesAreCompatible(CSharpCompilation compilation, TypeSymbol arrayType, TypeSymbol constructorParameterType, bool isReadOnlySpan)
419private BoundExpression VisitCollectionInitializerCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType)
612internal static bool IsAllocatingRefStructCollectionExpression(BoundCollectionExpressionBase node, CollectionExpressionTypeKind collectionKind, TypeSymbol? elementType, CSharpCompilation compilation)
621internal static bool ShouldUseRuntimeHelpersCreateSpan(BoundCollectionExpressionBase node, TypeSymbol elementType)
771var spreadTypeOriginalDefinition = spreadExpression.Type!.OriginalDefinition;
796var spanType = CallAsSpanMethod(spreadExpression, asSpanMethod).Type!.OriginalDefinition;
805bool tryGetToArrayMethod(TypeSymbol spreadTypeOriginalDefinition, WellKnownType wellKnownType, WellKnownMember wellKnownMember, [NotNullWhen(true)] out MethodSymbol? toArrayMethod)
807if (TypeSymbol.Equals(spreadTypeOriginalDefinition, this._compilation.GetWellKnownType(wellKnownType), TypeCompareKind.AllIgnoreOptions))
907var elementType = ((ArrayTypeSymbol)arrayTemp.Type).ElementType;
988private bool TryGetSpanConversion(TypeSymbol type, bool writableOnly, out MethodSymbol? asSpanMethod)
1035var type = expression.Type;
1278var elementType = ((NamedTypeSymbol)spanTemp.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (71)
69var rewrittenType = VisitType(node.Type);
81var toType = node.Type;
96var byteType = ((NamedTypeSymbol)node.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type;
225var type = rewrittenNode.Type;
268TypeSymbol rewrittenType)
304TypeSymbol rewrittenType)
626var sourceType = rewrittenOperand.Type;
641TypeSymbol parameterType = method.ParameterTypesWithAnnotations[0].Type;
755private void EnsureParamCollectionAttributeExists(SyntaxNode node, TypeSymbol delegateType)
768private static bool NeedsCheckedConversionInExpressionTree(TypeSymbol? source, TypeSymbol target, bool explicitCastInCode)
777SpecialType GetUnderlyingSpecialType(TypeSymbol type) =>
806private BoundExpression MakeConversionNode(BoundExpression rewrittenOperand, TypeSymbol rewrittenType, bool @checked, bool acceptFailingConversion = false, bool markAsChecked = false)
826TypeSymbol rewrittenType,
859TypeSymbol rewrittenType,
893if (!TypeSymbol.Equals(rewrittenOperand.Type, conversion.BestUserDefinedConversionAnalysis.FromType, TypeCompareKind.ConsiderEverything2))
903if (!TypeSymbol.Equals(rewrittenOperand.Type, conversion.Method.GetParameterType(0), TypeCompareKind.ConsiderEverything2))
912TypeSymbol userDefinedConversionRewrittenType = conversion.Method.ReturnType;
932if (!TypeSymbol.Equals(userDefined.Type, conversion.BestUserDefinedConversionAnalysis.ToType, TypeCompareKind.ConsiderEverything2))
941if (!TypeSymbol.Equals(userDefined.Type, rewrittenType, TypeCompareKind.ConsiderEverything2))
963Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
964Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
965Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
968if (!TypeSymbol.Equals(rewrittenOperand.Type, analysis.FromType, TypeCompareKind.AllIgnoreOptions))
979Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
986Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.ToType, TypeCompareKind.AllIgnoreOptions));
988if (!TypeSymbol.Equals(rewrittenOperand.Type, rewrittenType, TypeCompareKind.AllIgnoreOptions))
999Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, rewrittenType, TypeCompareKind.AllIgnoreOptions));
1109TypeSymbol rewrittenType)
1118TypeSymbol? rewrittenOperandType = rewrittenOperand.Type;
1165TypeSymbol rewrittenType)
1169TypeSymbol rewrittenOperandType = rewrittenOperand.Type;
1172TypeSymbol typeFrom = rewrittenOperandType.StrippedType();
1173TypeSymbol typeTo = rewrittenType.StrippedType();
1174if (!TypeSymbol.Equals(typeFrom, typeTo, TypeCompareKind.ConsiderEverything2) && (typeFrom.SpecialType == SpecialType.System_Decimal || typeTo.SpecialType == SpecialType.System_Decimal))
1177TypeSymbol typeFromUnderlying = typeFrom;
1178TypeSymbol typeToUnderlying = typeTo;
1217TypeSymbol type)
1278TypeSymbol type)
1311TypeSymbol type)
1351TypeSymbol type)
1382Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
1383Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
1384Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
1413TypeSymbol rewrittenType)
1419var parameterType = conversion.Method.GetParameterType(0);
1448Debug.Assert(TypeSymbol.Equals(result.Type, rewrittenType, TypeCompareKind.ConsiderEverything2));
1452private BoundExpression MakeLiftedUserDefinedConversionConsequence(BoundCall call, TypeSymbol resultType)
1456Debug.Assert(resultType.IsNullableType() && TypeSymbol.Equals(resultType.GetNullableUnderlyingType(), call.Method.ReturnType, TypeCompareKind.ConsiderEverything2));
1469TypeSymbol rewrittenType)
1600TypeSymbol rewrittenType)
1607TypeSymbol source = rewrittenOperand.Type;
1608TypeSymbol target = rewrittenType;
1649public static SpecialMember GetIntPtrConversionMethod(TypeSymbol source, TypeSymbol target)
1654TypeSymbol t0 = target.StrippedType();
1655TypeSymbol s0 = source.StrippedType();
1765private static SpecialMember DecimalConversionMethod(TypeSymbol typeFrom, TypeSymbol typeTo)
1809private BoundExpression RewriteDecimalConversion(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool @checked, bool isImplicit, ConstantValue? constantValueOpt)
1837static TypeSymbol get64BitType(CSharpCompilation compilation, bool signed) => compilation.GetSpecialType(signed ? SpecialType.System_Int64 : SpecialType.System_UInt64);
1840private BoundExpression RewriteDecimalConversionCore(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool isImplicit, ConstantValue? constantValueOpt)
1861Debug.Assert(TypeSymbol.Equals(method.ReturnType, toType, TypeCompareKind.ConsiderEverything2));
1869private Conversion TryMakeConversion(SyntaxNode syntax, Conversion conversion, TypeSymbol fromType, TypeSymbol toType, bool @checked)
1977private Conversion TryMakeConversion(SyntaxNode syntax, TypeSymbol fromType, TypeSymbol toType, bool @checked)
1988private Conversion TryMakeUserDefinedConversion(SyntaxNode syntax, MethodSymbol meth, TypeSymbol fromType, TypeSymbol toType, bool @checked, bool isImplicit)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (17)
43TypeSymbol? nodeExpressionType = collectionExpression.Type;
71private bool CanRewriteForEachAsFor(SyntaxNode forEachSyntax, TypeSymbol nodeExpressionType, [NotNullWhen(true)] out MethodSymbol? indexerGet, [NotNullWhen(true)] out MethodSymbol? lengthGet)
76internal static bool CanRewriteForEachAsFor(CSharpCompilation compilation, SyntaxNode forEachSyntax, TypeSymbol nodeExpressionType, [NotNullWhen(true)] out MethodSymbol? indexerGet, [NotNullWhen(true)] out MethodSymbol? lengthGet, BindingDiagnosticBag diagnostics)
79var origDefinition = nodeExpressionType.OriginalDefinition;
158TypeSymbol enumeratorType = getEnumeratorInfo.Method.ReturnType;
320TypeSymbol enumeratorType,
487TypeSymbol awaitExpressionType = disposeAwaitableInfoOpt.GetResult?.ReturnType ?? _compilation.DynamicType;
505private BoundExpression ConvertReceiverForInvocation(CSharpSyntaxNode syntax, BoundExpression receiver, MethodSymbol method, Conversion receiverConversion, TypeSymbol convertedReceiverType)
611TypeSymbol intType = _compilation.GetSpecialType(SpecialType.System_Int32);
612TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
783TypeSymbol inlineArrayType = boundArrayVar.Type;
912TypeSymbol intType = _compilation.GetSpecialType(SpecialType.System_Int32);
913TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1062TypeSymbol intType = _compilation.GetSpecialType(SpecialType.System_Int32);
1063TypeSymbol boolType = _compilation.GetSpecialType(SpecialType.System_Boolean);
1231private static BoundLocal MakeBoundLocal(CSharpSyntaxNode syntax, LocalSymbol local, TypeSymbol type)
1251private BoundStatement MakePositionIncrement(CSharpSyntaxNode syntax, BoundLocal boundPositionVar, TypeSymbol intType)
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (6)
226var rewrittenType = VisitType(initializer.Type);
400Debug.Assert(assignment.Type.IsDynamic() || TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
472Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
505Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
517if (TypeSymbol.Equals(implicitIndexer.Argument.Type, _compilation.GetWellKnownType(WellKnownType.System_Index), TypeCompareKind.ConsiderEverything))
540Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (6)
30var boolType = node.Type; // we can re-use the bool type
69var elementType = resultTypes[i].Type;
251BoundExpression left, BoundExpression right, TypeSymbol boolType,
272TypeSymbol boolType, ArrayBuilder<LocalSymbol> temps, BinaryOperatorKind operatorKind)
492BoundExpression left, BoundExpression right, TypeSymbol type,
549BoundExpression left, BoundExpression right, TypeSymbol boolType, BinaryOperatorKind operatorKind)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (27)
67TypeSymbol? constrainedToTypeOpt,
69TypeSymbol type)
79TypeSymbol? constrainedToTypeOpt,
81TypeSymbol type)
114Debug.Assert(TypeSymbol.Equals(type, method.ReturnType, TypeCompareKind.ConsiderEverything2));
183TypeSymbol? constrainedToTypeOpt,
185TypeSymbol type)
247TypeSymbol? constrainedToTypeOpt,
249TypeSymbol type)
328Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
329Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
330Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
354private BoundExpression GetLiftedUnaryOperatorConsequence(UnaryOperatorKind kind, SyntaxNode syntax, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, BoundExpression nonNullOperand)
421TypeSymbol? operandType = node.Operand.Type; //type of the variable being incremented
423Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.AllIgnoreOptions));
458TypeSymbol? operandType = left.Type; //type of the variable being incremented
467Debug.Assert(TypeSymbol.Equals(operandType, transformedLHS.Type, TypeCompareKind.AllIgnoreOptions));
587TypeSymbol? operandType = transformedLHS.Type; //type of the variable being incremented
589Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.ConsiderEverything2));
801TypeSymbol type = node.MethodOpt.GetParameterType(0);
805Debug.Assert(TypeSymbol.Equals(node.MethodOpt.GetParameterType(0), node.MethodOpt.ReturnType, TypeCompareKind.ConsiderEverything2));
891TypeSymbol unaryOperandType = GetUnaryOperatorType(node);
900(TypeSymbol binaryOperandType, ConstantValue constantOne) = GetConstantOneForIncrement(_compilation, binaryOperatorKind);
1058private TypeSymbol GetUnaryOperatorType(BoundIncrementOperator node)
1179TypeSymbol? underlyingType = node.Type;
1245private static (TypeSymbol, ConstantValue) GetConstantOneForIncrement(
Lowering\StateMachineRewriter\RefInitializationHoister.cs (5)
44/// <param name="createHoistedSymbol">Factory that creates a new hoisted symbol for a sub-expression value of a given <see cref="TypeSymbol"/>.</param>
62Func<TypeSymbol, TArg, LocalSymbol, THoistedSymbol> createHoistedSymbol,
96var type = _typeMap.SubstituteType(local.Type).Type;
98Debug.Assert(TypeSymbol.Equals(type, replacement.Type, TypeCompareKind.ConsiderEverything2));
141Func<TypeSymbol, TArg, LocalSymbol, THoistedSymbol> createHoistedSymbol,
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (2)
38public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, SynthesizedLocalKind synthesizedKind, int slotIndex, bool isPublic)
43public StateMachineFieldSymbol(NamedTypeSymbol stateMachineType, TypeSymbol type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex, bool isPublic) :
Lowering\SyntheticBoundNodeFactory.cs (51)
139Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
148TypeSymbol.Equals(CurrentFunction.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
183public StateMachineFieldSymbol StateMachineField(TypeSymbol type, string name, bool isPublic = false, bool isThis = false)
191public StateMachineFieldSymbol StateMachineFieldForRegularParameter(TypeSymbol type, string name, ParameterSymbol parameter, bool isPublic)
199public StateMachineFieldSymbol StateMachineField(TypeSymbol type, string name, SynthesizedLocalKind synthesizedKind, int slotIndex)
207public StateMachineFieldSymbol StateMachineField(TypeSymbol type, string name, LocalSlotDebugInfo slotDebugInfo, int slotIndex)
244public BoundBadExpression BadExpression(TypeSymbol type)
601TypeSymbol type,
623TypeSymbol type,
643public ParameterSymbol SynthesizedParameter(TypeSymbol type, string name, MethodSymbol? container = null, int ordinal = 0)
648public BoundBinaryOperator Binary(BinaryOperatorKind kind, TypeSymbol type, BoundExpression left, BoundExpression right)
653public BoundAsOperator As(BoundExpression operand, TypeSymbol type)
658public BoundIsOperator Is(BoundExpression operand, TypeSymbol type)
760public BoundLiteral Literal(ConstantValue value, TypeSymbol type)
819public BoundExpression StaticCall(TypeSymbol receiver, MethodSymbol method, params BoundExpression[] args)
840public BoundExpression StaticCall(WellKnownMember method, ImmutableArray<TypeSymbol> typeArgs, params BoundExpression[] args)
933public BoundExpression Conditional(BoundExpression condition, BoundExpression consequence, BoundExpression alternative, TypeSymbol type, bool isRef = false)
941Debug.Assert(TypeSymbol.Equals(valueTypeReceiver.Type, referenceTypeReceiver.Type, TypeCompareKind.ConsiderEverything2));
1056public BoundSequence Sequence(BoundExpression[] sideEffects, BoundExpression result, TypeSymbol? type = null)
1059var resultType = type ?? result.Type;
1251public BoundExpression ThrowExpression(BoundExpression thrown, TypeSymbol type)
1256public BoundExpression Null(TypeSymbol type)
1268public static BoundExpression Null(TypeSymbol type, SyntaxNode syntax)
1277public BoundTypeExpression Type(TypeSymbol type)
1282public BoundExpression Typeof(WellKnownType type, TypeSymbol systemType)
1287public BoundExpression Typeof(TypeSymbol type, TypeSymbol systemType)
1303Debug.Assert(TypeSymbol.Equals(systemType, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions));
1313public BoundExpression Typeof(TypeWithAnnotations type, TypeSymbol systemType)
1318public ImmutableArray<BoundExpression> TypeOfs(ImmutableArray<TypeWithAnnotations> typeArguments, TypeSymbol systemType)
1329public BoundExpression Sizeof(TypeSymbol type)
1403public BoundExpression InstrumentationPayloadRoot(int analysisKind, TypeSymbol payloadType)
1434public BoundExpression MethodInfo(MethodSymbol method, TypeSymbol systemReflectionMethodInfo)
1469private MethodSymbol GetMethodFromHandleMethod(NamedTypeSymbol methodContainer, TypeSymbol systemReflectionMethodOrConstructorInfo)
1503/// and then calls <see cref="Convert(TypeSymbol, BoundExpression, Conversion, bool, bool)"/>.
1507public Conversion ClassifyEmitConversion(BoundExpression arg, TypeSymbol destination)
1520public BoundExpression Convert(TypeSymbol type, BoundExpression arg, Conversion conversion, bool isChecked = false, bool explicitCastInCode = true)
1524if (TypeSymbol.Equals(type, arg.Type, TypeCompareKind.ConsiderEverything2))
1538public BoundExpression ArrayOrEmpty(TypeSymbol elementType, BoundExpression[] elements)
1550public BoundExpression ArrayOrEmpty(TypeSymbol elementType, ImmutableArray<BoundExpression> elements)
1565public BoundExpression Array(TypeSymbol elementType, ImmutableArray<BoundExpression> elements)
1574public BoundExpression Array(TypeSymbol elementType, BoundExpression length)
1584internal BoundExpression Default(TypeSymbol type)
1589internal static BoundExpression Default(TypeSymbol type, SyntaxNode syntax)
1629internal BoundExpression NullOrDefault(TypeSymbol typeSymbol)
1634internal static BoundExpression NullOrDefault(TypeSymbol typeSymbol, SyntaxNode syntax)
1695var type = argument.Type;
1765TypeSymbol exprType = rewrittenExpr.Type;
1774TypeSymbol boolType = Compilation.GetSpecialType(CodeAnalysis.SpecialType.System_Boolean);
1788TypeSymbol objectType = SpecialType(CodeAnalysis.SpecialType.System_Object);
1827TypeSymbol returnType)
Operations\CSharpOperationFactory.cs (11)
779return CreateBoundDynamicMemberAccessOperation(implicitReceiver, typeArgumentsOpt: ImmutableArray<TypeSymbol>.Empty, memberName: "Add",
966ImmutableArray<TypeSymbol> typeArgumentsOpt,
1122if (boundOperand.Kind == BoundKind.ConvertedTupleLiteral && TypeSymbol.Equals(boundOperand.Type, boundConversion.Type, TypeCompareKind.ConsiderEverything2))
1143!TypeSymbol.Equals(nestedConversion.Type, nestedOperand.Type, TypeCompareKind.ConsiderEverything2))
1449private static TypeParameterSymbol? GetConstrainedToTypeForOperator(MethodSymbol? operatorMethod, TypeSymbol? constrainedToTypeOpt)
1572TypeSymbol? constrainedToTypeOpt = GetConstrainedToTypeForOperator(boundBinaryOperator.LogicalOperator, boundBinaryOperator.ConstrainedToTypeOpt) ??
2308TypeSymbol? naturalType = boundTupleExpression switch
2586TypeSymbol inputType = boundConstantPattern.InputType;
2587TypeSymbol narrowedType = boundConstantPattern.NarrowedType;
2597TypeSymbol inputType = boundRelationalPattern.InputType;
2598TypeSymbol narrowedType = boundRelationalPattern.NarrowedType;
Symbols\Attributes\AttributeData.cs (7)
250internal static void DecodeMemberNotNullAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
286private static void ReportBadNotNullMemberIfNeeded(TypeSymbol type, DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments, string memberName)
300internal static void DecodeMemberNotNullWhenAttribute<T>(TypeSymbol type, ref DecodeWellKnownAttributeArguments<AttributeSyntax, CSharpAttributeData, AttributeLocation> arguments)
367var firstArgType = (TypeSymbol?)firstArg.TypeInternal;
642var builderType = (TypeSymbol?)CommonConstructorArguments[0].ValueInternal;
Symbols\Compilation_WellKnownMembers.cs (49)
187TypeSymbol.Equals(result, _lazyWellKnownTypes[index], TypeCompareKind.ConsiderEverything2) || (_lazyWellKnownTypes[index]!.IsErrorType() && result.IsErrorType())
201internal bool IsAttributeType(TypeSymbol type)
212internal bool IsExceptionType(TypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
217internal bool IsReadOnlySpanType(TypeSymbol type)
219return TypeSymbol.Equals(type.OriginalDefinition, GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.ConsiderEverything2);
222internal bool IsEqualOrDerivedFromWellKnownClass(TypeSymbol type, WellKnownType wellKnownType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
238return TypeSymbol.Equals((TypeSymbol)type, GetWellKnownType(WellKnownType.System_Type), TypeCompareKind.ConsiderEverything2);
251internal static Symbol? GetRuntimeMember(NamedTypeSymbol declaringType, in MemberDescriptor descriptor, SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol> comparer, AssemblySymbol? accessWithinOpt)
257internal static Symbol? GetRuntimeMember(ImmutableArray<Symbol> members, in MemberDescriptor descriptor, SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol> comparer, AssemblySymbol? accessWithinOpt)
742TypeSymbol debuggableAttribute = GetWellKnownType(WellKnownType.System_Diagnostics_DebuggableAttribute);
749TypeSymbol debuggingModesType = GetWellKnownType(WellKnownType.System_Diagnostics_DebuggableAttribute__DebuggingModes);
817internal SynthesizedAttributeData? SynthesizeDynamicAttribute(TypeSymbol type, int customModifiersCount, RefKind refKindOpt = RefKind.None)
837internal SynthesizedAttributeData? SynthesizeTupleNamesAttribute(TypeSymbol type)
867public static ImmutableArray<string?> Encode(TypeSymbol type)
880public static ImmutableArray<TypedConstant> Encode(TypeSymbol type, TypeSymbol stringType)
896internal static bool TryGetNames(TypeSymbol type, ArrayBuilder<string?> namesBuilder)
902private static bool AddNames(TypeSymbol type, ArrayBuilder<string?> namesBuilder)
931internal static ImmutableArray<TypedConstant> Encode(TypeSymbol type, RefKind refKind, int customModifiersCount, TypeSymbol booleanType)
943internal static ImmutableArray<bool> Encode(TypeSymbol type, RefKind refKind, int customModifiersCount)
950internal static ImmutableArray<bool> EncodeWithoutCustomModifierFlags(TypeSymbol type, RefKind refKind)
957internal static void Encode(TypeSymbol type, int customModifiersCount, RefKind refKind, ArrayBuilder<bool> transformFlagsBuilder, bool addCustomModifierFlags)
979private static bool AddFlags(TypeSymbol type, ArrayBuilder<bool> transformFlagsBuilder, bool isNestedNamedType, bool addCustomModifierFlags)
1038Func<TypeSymbol, (ArrayBuilder<bool>, bool), bool, bool> visitor =
1039(TypeSymbol type, (ArrayBuilder<bool> builder, bool addCustomModifierFlags) param, bool isNestedNamedType) => AddFlags(type, param.builder, isNestedNamedType, param.addCustomModifierFlags);
1083internal static void Encode(ArrayBuilder<bool> builder, TypeSymbol type)
1089private static bool AddFlags(TypeSymbol type, ArrayBuilder<bool> builder)
1103internal class SpecialMembersSignatureComparer : SignatureComparer<MethodSymbol, FieldSymbol, PropertySymbol, TypeSymbol, ParameterSymbol>
1113protected override TypeSymbol? GetMDArrayElementType(TypeSymbol type)
1127protected override TypeSymbol GetFieldType(FieldSymbol field)
1132protected override TypeSymbol GetPropertyType(PropertySymbol property)
1137protected override TypeSymbol? GetGenericTypeArgument(TypeSymbol type, int argumentIndex)
1155protected override TypeSymbol? GetGenericTypeDefinition(TypeSymbol type)
1183protected override TypeSymbol GetParamType(ParameterSymbol parameter)
1188protected override TypeSymbol? GetPointedToType(TypeSymbol type)
1193protected override TypeSymbol GetReturnType(MethodSymbol method)
1198protected override TypeSymbol? GetSZArrayElementType(TypeSymbol type)
1227protected override bool IsGenericMethodTypeParam(TypeSymbol type, int paramPosition)
1241protected override bool IsGenericTypeParam(TypeSymbol type, int paramPosition)
1255protected override bool MatchArrayRank(TypeSymbol type, int countOfDimensions)
1266protected override bool MatchTypeToTypeId(TypeSymbol type, int typeId)
1291protected override bool MatchTypeToTypeId(TypeSymbol type, int typeId)
Symbols\ConstraintsHelper.cs (20)
144TypeSymbol deducedBaseType = effectiveBaseClass;
164TypeSymbol constraintDeducedBase;
241var underlyingType = constraintType.Type.GetNullableUnderlyingType();
469var deducedBase = bounds.DeducedBaseType;
489this TypeSymbol type,
502this TypeSymbol type,
519public static void CheckAllConstraints(this TypeSymbol type, CheckConstraintsArgsBoxed args)
585private static readonly Func<TypeSymbol, CheckConstraintsArgsBoxed, bool, bool> s_checkConstraintsSingleTypeFunc = (type, arg, unused) => CheckConstraintsSingleType(type, in arg.Args);
587private static bool CheckConstraintsSingleType(TypeSymbol type, in CheckConstraintsArgs args)
681ConsList<TypeSymbol> basesBeingResolved)
758private static bool HasDuplicateInterfaces(NamedTypeSymbol type, ConsList<TypeSymbol> basesBeingResolved)
1228var type = typeWithAnnotations.Type;
1271var type = typeWithAnnotations.Type;
1449private static TypeParameterDiagnosticInfo GenerateConflictingConstraintsError(TypeParameterSymbol typeParameter, TypeSymbol deducedBase, bool classConflict)
1479private static ConstructorConstraintError SatisfiesConstructorConstraint(TypeSymbol typeArgument)
1550private static bool IsEncompassedBy(ConversionsBase conversions, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1561private static bool IsValidEncompassedByArgument(TypeSymbol type)
1622private static void CheckEffectiveAndDeducedBaseTypes(ConversionsBase conversions, TypeSymbol effectiveBase, TypeSymbol deducedBase)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (9)
23public static FunctionPointerMethodSymbol CreateFromSource(FunctionPointerTypeSyntax syntax, Binder typeBinder, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved, bool suppressUseSiteDiagnostics)
330public static FunctionPointerMethodSymbol CreateFromMetadata(ModuleSymbol containingModule, CallingConvention callingConvention, ImmutableArray<ParamInfo<TypeSymbol>> retAndParamTypes)
543private FunctionPointerMethodSymbol(CallingConvention callingConvention, ImmutableArray<ParamInfo<TypeSymbol>> retAndParamTypes, bool useUpdatedEscapeRules)
547ParamInfo<TypeSymbol> retInfo = retAndParamTypes[0];
558static ImmutableArray<FunctionPointerParameterSymbol> makeParametersFromMetadata(ReadOnlySpan<ParamInfo<TypeSymbol>> parameterTypes, FunctionPointerMethodSymbol parent)
566ParamInfo<TypeSymbol> param = parameterTypes[i];
581static RefKind getRefKind(ParamInfo<TypeSymbol> param, ImmutableArray<CustomModifier> paramRefCustomMods, RefKind hasInRefKind, RefKind hasOutRefKind, bool requiresLocationAllowed)
800internal bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
869internal sealed override bool HasAsyncMethodBuilderAttribute(out TypeSymbol? builderArgument)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (9)
19public static FunctionPointerTypeSymbol CreateFromSource(FunctionPointerTypeSyntax syntax, Binder typeBinder, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved, bool suppressUseSiteDiagnostics)
56public static FunctionPointerTypeSymbol CreateFromMetadata(ModuleSymbol containingModule, Cci.CallingConvention callingConvention, ImmutableArray<ParamInfo<TypeSymbol>> retAndParamTypes)
98internal override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol>? basesBeingResolved = null) => ImmutableArray<NamedTypeSymbol>.Empty;
100internal override bool Equals(TypeSymbol t2, TypeCompareKind compareKind)
136internal override bool ApplyNullableTransforms(byte defaultTransformFlag, ImmutableArray<byte> transforms, ref int position, out TypeSymbol result)
156internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo? result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
161internal override TypeSymbol MergeEquivalentTypes(TypeSymbol other, VarianceKind variance)
173internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
Symbols\Metadata\PE\DynamicTypeDecoder.cs (17)
64internal static TypeSymbol TransformType(
65TypeSymbol metadataType,
86internal static TypeSymbol TransformTypeWithoutCustomModifierFlags(
87TypeSymbol type,
103private static TypeSymbol TransformTypeInternal(
104TypeSymbol metadataType,
126TypeSymbol transformedType = decoder.TransformType(metadataType);
140private TypeSymbol TransformType(TypeSymbol type)
252bool containerIsChanged = (!TypeSymbol.Equals(newContainingType, containingType, TypeCompareKind.ConsiderEverything2));
281TypeSymbol transformedTypeArg = TransformType(typeArg.Type);
290anyTransformed |= !TypeSymbol.Equals(transformedTypeArg, typeArg.Type, TypeCompareKind.ConsiderEverything2);
312TypeSymbol transformedElementType = TransformType(arrayType.ElementType);
318return TypeSymbol.Equals(transformedElementType, arrayType.ElementType, TypeCompareKind.ConsiderEverything2) ?
335TypeSymbol transformedPointedAtType = TransformType(pointerType.PointedAtType);
341return TypeSymbol.Equals(transformedPointedAtType, pointerType.PointedAtType, TypeCompareKind.ConsiderEverything2) ?
407var transformedType = decoder.TransformType(typeWithAnnotations.Type);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (18)
31private readonly TypeSymbol _containingType;
35TypeSymbol containingType) :
49protected override TypeSymbol GetGenericMethodTypeParamSymbol(int position)
58protected override TypeSymbol GetGenericTypeParamSymbol(int position)
150ParamInfo<TypeSymbol>[] targetParamInfo = this.DecodeSignatureParametersOrThrow(ref signaturePointer, signatureHeader, out typeParamCount);
160FieldInfo<TypeSymbol> fieldInfo = this.DecodeFieldSignature(ref signaturePointer);
174private static FieldSymbol FindFieldBySignature(TypeSymbol targetTypeSymbol, string targetMemberName, in FieldInfo<TypeSymbol> fieldInfo)
185TypeSymbol.Equals((fieldType = field.TypeWithAnnotations).Type, fieldInfo.Type, TypeCompareKind.CLRSignatureCompareOptions) &&
197private static MethodSymbol FindMethodBySignature(TypeSymbol targetTypeSymbol, string targetMemberName, SignatureHeader targetMemberSignatureHeader, int targetMemberTypeParamCount, ParamInfo<TypeSymbol>[] targetParamInfo)
216private static bool MethodSymbolMatchesParamInfo(MethodSymbol candidateMethod, ParamInfo<TypeSymbol>[] targetParamInfo)
247private static bool ParametersMatch(ParameterSymbol candidateParam, TypeMap candidateMethodTypeMap, ref ParamInfo<TypeSymbol> targetParam)
261if (!TypeSymbol.Equals(substituted.Type, targetParam.Type, TypeCompareKind.CLRSignatureCompareOptions))
275private static bool ReturnTypesMatch(MethodSymbol candidateMethod, TypeMap candidateMethodTypeMap, ref ParamInfo<TypeSymbol> targetReturnParam)
285TypeSymbol targetReturnType = targetReturnParam.Type;
289if (!TypeSymbol.Equals(substituted.Type, targetReturnType, TypeCompareKind.CLRSignatureCompareOptions))
303private static bool CustomModifiersMatch(ImmutableArray<CustomModifier> candidateCustomModifiers, ImmutableArray<ModifierInfo<TypeSymbol>> targetCustomModifiers)
Symbols\Metadata\PE\MetadataDecoder.cs (26)
21internal class MetadataDecoder : MetadataDecoder<PEModuleSymbol, TypeSymbol, MethodSymbol, FieldSymbol, Symbol>
69protected override TypeSymbol GetGenericMethodTypeParamSymbol(int position)
86protected override TypeSymbol GetGenericTypeParamSymbol(int position)
106protected override ConcurrentDictionary<TypeDefinitionHandle, TypeSymbol> GetTypeHandleToTypeMap()
111protected override ConcurrentDictionary<TypeReferenceHandle, TypeSymbol> GetTypeRefHandleToTypeMap()
118protected override TypeSymbol LookupNestedTypeDefSymbol(TypeSymbol container, ref MetadataTypeName emittedName)
132protected override TypeSymbol LookupTopLevelTypeDefSymbol(
155protected override TypeSymbol LookupTopLevelTypeDefSymbol(string moduleName, ref MetadataTypeName emittedName, out bool isNoPiaLocalType)
187protected override TypeSymbol LookupTopLevelTypeDefSymbol(ref MetadataTypeName emittedName, out bool isNoPiaLocalType)
214public static bool IsOrClosedOverATypeFromAssemblies(TypeSymbol symbol, ImmutableArray<AssemblySymbol> assemblies)
272protected override TypeSymbol SubstituteNoPiaLocalType(
279TypeSymbol result;
284TypeSymbol baseType = null;
312ConcurrentDictionary<TypeDefinitionHandle, TypeSymbol> cache = GetTypeHandleToTypeMap();
315TypeSymbol newresult = cache.GetOrAdd(typeDef, result);
332TypeSymbol baseType,
488protected override MethodSymbol FindMethodSymbolInType(TypeSymbol typeSymbol, MethodDefinitionHandle targetMethodDef)
515protected override FieldSymbol FindFieldSymbolInType(TypeSymbol typeSymbol, FieldDefinitionHandle fieldDef)
531internal override Symbol GetSymbolForMemberRef(MemberReferenceHandle memberRef, TypeSymbol scope = null, bool methodsOnly = false)
533TypeSymbol targetTypeSymbol = GetMemberRefTypeSymbol(memberRef);
548if (!TypeSymbol.Equals(scope, targetTypeSymbol, TypeCompareKind.ConsiderEverything2) &&
576protected override void EnqueueTypeSymbolInterfacesAndBaseTypes(Queue<TypeDefinitionHandle> typeDefsToSearch, Queue<TypeSymbol> typeSymbolsToSearch, TypeSymbol typeSymbol)
586protected override void EnqueueTypeSymbol(Queue<TypeDefinitionHandle> typeDefsToSearch, Queue<TypeSymbol> typeSymbolsToSearch, TypeSymbol typeSymbol)
Symbols\Metadata\PE\PEEventSymbol.cs (10)
93TypeSymbol originalEventType = _eventTypeWithAnnotations.Type;
100var typeSymbol = DynamicTypeDecoder.TransformType(originalEventType, targetSymbolCustomModifierCount, handle, moduleSymbol);
167TypeSymbol candidateAssociatedFieldType = candidateAssociatedField.Type;
172if (TypeSymbol.Equals(eventRegistrationTokenTable_T, candidateAssociatedFieldType.OriginalDefinition, TypeCompareKind.ConsiderEverything2) &&
173TypeSymbol.Equals(_eventTypeWithAnnotations.Type, ((NamedTypeSymbol)candidateAssociatedFieldType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Type, TypeCompareKind.ConsiderEverything2))
180if (TypeSymbol.Equals(candidateAssociatedFieldType, _eventTypeWithAnnotations.Type, TypeCompareKind.ConsiderEverything2))
205TypeSymbol.Equals(_addMethod.ReturnType, token, TypeCompareKind.ConsiderEverything2) &&
208TypeSymbol.Equals(_removeMethod.Parameters[0].Type, token, TypeCompareKind.ConsiderEverything2);
456TypeSymbol eventType,
483TypeSymbol eventType,
Symbols\Metadata\PE\PEParameterSymbol.cs (7)
197ParamInfo<TypeSymbol> parameterInfo,
225ParamInfo<TypeSymbol> parameterInfo,
309var typeSymbol = DynamicTypeDecoder.TransformType(typeWithAnnotations.Type, countOfCustomModifiers, handle, moduleSymbol, refKind);
400ImmutableArray<ModifierInfo<TypeSymbol>> refCustomModifiers,
401TypeSymbol type,
404ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers,
446ImmutableArray<ModifierInfo<TypeSymbol>> refCustomModifiers,
Symbols\Metadata\PE\SymbolFactory.cs (26)
14internal sealed class SymbolFactory : SymbolFactory<PEModuleSymbol, TypeSymbol>
18internal override TypeSymbol GetMDArrayTypeSymbol(PEModuleSymbol moduleSymbol, int rank, TypeSymbol elementType, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers,
29internal override TypeSymbol GetSpecialType(PEModuleSymbol moduleSymbol, SpecialType specialType)
34internal override TypeSymbol GetSystemTypeSymbol(PEModuleSymbol moduleSymbol)
39internal override TypeSymbol MakePointerTypeSymbol(PEModuleSymbol moduleSymbol, TypeSymbol type, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers)
49internal override TypeSymbol MakeFunctionPointerTypeSymbol(PEModuleSymbol moduleSymbol, Cci.CallingConvention callingConvention, ImmutableArray<ParamInfo<TypeSymbol>> retAndParamTypes)
54internal override TypeSymbol GetEnumUnderlyingType(PEModuleSymbol moduleSymbol, TypeSymbol type)
59internal override Cci.PrimitiveTypeCode GetPrimitiveTypeCode(PEModuleSymbol moduleSymbol, TypeSymbol type)
64internal override TypeSymbol GetSZArrayTypeSymbol(PEModuleSymbol moduleSymbol, TypeSymbol elementType, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers)
74internal override TypeSymbol GetUnsupportedMetadataTypeSymbol(PEModuleSymbol moduleSymbol, BadImageFormatException exception)
79internal override TypeSymbol SubstituteTypeParameters(
81TypeSymbol genericTypeDef,
82ImmutableArray<KeyValuePair<TypeSymbol, ImmutableArray<ModifierInfo<TypeSymbol>>>> arguments,
161internal override TypeSymbol MakeUnboundIfGeneric(PEModuleSymbol moduleSymbol, TypeSymbol type)
167private static TypeWithAnnotations CreateType(TypeSymbol type, ImmutableArray<ModifierInfo<TypeSymbol>> customModifiers)
Symbols\NamedTypeSymbol.cs (28)
1005internal abstract NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved);
1007internal abstract ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved);
1026internal override bool Equals(TypeSymbol t2, TypeCompareKind comparison)
1162internal override bool ApplyNullableTransforms(byte defaultTransformFlag, ImmutableArray<byte> transforms, ref int position, out TypeSymbol result)
1196internal override TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform)
1230internal override TypeSymbol MergeEquivalentTypes(TypeSymbol other, VarianceKind variance)
1342public NamedTypeSymbol Construct(params TypeSymbol[] typeArguments)
1353public NamedTypeSymbol Construct(ImmutableArray<TypeSymbol> typeArguments)
1363public NamedTypeSymbol Construct(IEnumerable<TypeSymbol> typeArguments)
1392internal abstract bool HasAsyncMethodBuilderAttribute(out TypeSymbol builderArgument);
1405private NamedTypeSymbol ConstructWithoutModifiers(ImmutableArray<TypeSymbol> typeArguments, bool unbound)
1504internal void GetAllTypeArguments(ref TemporaryArray<TypeSymbol> builder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1573protected sealed override TypeSymbol OriginalTypeSymbolDefinition
1653HashSet<TypeSymbol> unificationCheckedTypes = null;
1680internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
1855internal abstract bool HasCollectionBuilderAttribute(out TypeSymbol? builderType, out string? methodName);
1859/// Requires less computation than <see cref="TypeSymbol.TypeKind"/> == <see cref="TypeKind.Interface"/>.
1881internal ImmutableArray<TypeSymbol> UnionCaseTypesNoUseSiteDiagnostics
1890internal ImmutableArray<TypeSymbol> UnionCaseTypes(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) // https://github.com/dotnet/roslyn/issues/82636: Cache result?
1897var builder = ArrayBuilder<TypeSymbol>.GetInstance();
1898var set = TypeSymbol.AllIgnoreOptionsSetPool.Allocate();
1903static bool addCaseType(MethodSymbol factory, (ArrayBuilder<TypeSymbol> builder, PooledHashSet<TypeSymbol> set) arg)
1905(ArrayBuilder<TypeSymbol> builder, HashSet<TypeSymbol> set) = arg;
1906var candidate = factory.Parameters[0].Type;
2091TypeSymbol typeToCheck = this;
Symbols\Retargeting\RetargetingSymbolTranslator.cs (18)
171return marshallingInfo?.WithTranslatedTypes<TypeSymbol, RetargetingSymbolTranslator>(
175public TypeSymbol Retarget(TypeSymbol symbol, RetargetOptions options)
177return (TypeSymbol)symbol.Accept(this, options);
182var newTypeSymbol = Retarget(underlyingType.Type, options);
192if (modifiersHaveChanged || !TypeSymbol.Equals(underlyingType.Type, newTypeSymbol, TypeCompareKind.ConsiderEverything2))
406TypeSymbol? cached;
475Debug.Assert(TypeSymbol.Equals(result1, result, TypeCompareKind.ConsiderEverything2));
643private bool IsOrClosedOverAnExplicitLocalType(TypeSymbol symbol)
848public ImmutableArray<TypeSymbol> Retarget(ImmutableArray<TypeSymbol> sequence)
1119if (TypeSymbol.Equals(retargetedEvent.Type, targetType.Type, TypeCompareKind.ConsiderEverything2))
1223TypeSymbol oldConstantType = (TypeSymbol)oldConstant.TypeInternal;
1224TypeSymbol newConstantType = (object)oldConstantType == null ?
1231if (!TypeSymbol.Equals(newConstantType, oldConstantType, TypeCompareKind.ConsiderEverything2) || newArray != oldConstant.Values)
1246newConstantValue = Retarget((TypeSymbol)oldConstantValue, RetargetOptions.RetargetPrimitiveTypesByTypeCode);
1253if (!TypeSymbol.Equals(newConstantType, oldConstantType, TypeCompareKind.ConsiderEverything2) || newConstantValue != oldConstantValue)
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (12)
66internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved)
226var curBaseSym = baseBinder.BindType(b, BindingDiagnosticBag.Discarded).Type;
255internal Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> GetDeclaredBases(ConsList<TypeSymbol> basesBeingResolved)
270internal override NamedTypeSymbol GetDeclaredBaseType(ConsList<TypeSymbol> basesBeingResolved)
275internal override ImmutableArray<NamedTypeSymbol> GetDeclaredInterfaces(ConsList<TypeSymbol> basesBeingResolved)
280private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeDeclaredBases(ConsList<TypeSymbol> basesBeingResolved, BindingDiagnosticBag diagnostics)
319else if ((object)partBase != null && !TypeSymbol.Equals(partBase, baseType, TypeCompareKind.ConsiderEverything) && partBase.TypeKind != TypeKind.Error)
347static bool containsOnlyOblivious(TypeSymbol type)
493private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeOneDeclaredBases(ConsList<TypeSymbol> newBasesBeingResolved, SingleTypeDeclaration decl, BindingDiagnosticBag diagnostics)
522TypeSymbol baseType;
685void checkPrimaryConstructorBaseType(BaseTypeSyntax baseTypeSyntax, TypeSymbol baseType)
719private ImmutableArray<NamedTypeSymbol> MakeAcyclicInterfaces(ConsList<TypeSymbol> basesBeingResolved, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (6)
157static void AppendClrType(TypeSymbol type, ImmutableArray<CustomModifier> modifiers, StringBuilder builder)
193static void appendNamedType(TypeSymbol type, StringBuilder builder, NamedTypeSymbol namedType)
464static void appendType(TypeSymbol type, StringBuilder builder)
903AppendClrType((TypeSymbol)argument.ValueInternal, modifiers: [], builder);
1175internal static Symbol? ReduceExtensionMember(CSharpCompilation? compilation, Symbol extensionMember, TypeSymbol receiverType, out bool wasExtensionFullyInferred)
1215static NamedTypeSymbol? inferExtensionTypeArguments(NamedTypeSymbol extension, TypeSymbol receiverType, CSharpCompilation? compilation, out bool wasExtensionFullyInferred)
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (21)
21public Imports GetImports(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
143public ImmutableArray<AliasAndUsingDirective> GetUsingAliases(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
174public ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
206public ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
238private Imports GetGlobalUsingImports(ConsList<TypeSymbol>? basesBeingResolved)
243private ImmutableDictionary<string, AliasAndUsingDirective> GetGlobalUsingAliasesMap(ConsList<TypeSymbol>? basesBeingResolved)
248private ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(ConsList<TypeSymbol>? basesBeingResolved)
253private MergedGlobalAliasesAndUsings GetMergedGlobalAliasesAndUsings(ConsList<TypeSymbol>? basesBeingResolved, CancellationToken cancellationToken = default)
510internal ImmutableArray<AliasAndUsingDirective> GetUsingAliases(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
515internal ImmutableArray<AliasAndUsingDirective> GetGlobalUsingAliases(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
520internal ImmutableDictionary<string, AliasAndUsingDirective> GetUsingAliasesMap(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
525internal ImmutableDictionary<string, AliasAndUsingDirective> GetGlobalUsingAliasesMap(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
530internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
535private UsingsAndDiagnostics GetUsingsAndDiagnostics(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
540internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
545private UsingsAndDiagnostics GetGlobalUsingsAndDiagnostics(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
550private UsingsAndDiagnostics GetUsingsAndDiagnostics(ref UsingsAndDiagnostics? usings, SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved, bool onlyGlobal)
620ConsList<TypeSymbol>? basesBeingResolved)
912internal Imports GetImports(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
1040var typeSymbol = (TypeSymbol)target;
Symbols\Symbol.cs (7)
1221internal bool DeriveUseSiteInfoFromType(ref UseSiteInfo<AssemblySymbol> result, TypeSymbol type)
1353internal static bool GetUnificationUseSiteDiagnosticRecursive<T>(ref DiagnosticInfo result, ImmutableArray<T> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) where T : TypeSymbol
1366internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeWithAnnotations> types, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
1379internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<CustomModifier> modifiers, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
1392internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<ParameterSymbol> parameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
1406internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeParameterSymbol> typeParameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
Symbols\SymbolExtensions.cs (13)
88public static bool IsNoMoreVisibleThan(this Symbol symbol, TypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
220public static bool IsContainingSymbolOfAllTypeParameters(this Symbol containingSymbol, TypeSymbol type)
229public static bool IsContainingSymbolOfAllTypeParameters(this Symbol containingSymbol, ImmutableArray<TypeSymbol> types)
234private static readonly Func<TypeSymbol, Symbol, bool, bool> s_hasInvalidTypeParameterFunc =
237private static bool HasInvalidTypeParameter(TypeSymbol type, Symbol? containingSymbol)
269Debug.Assert(!(symbol is TypeSymbol));
408internal static TypeSymbol? EnsureCSharpSymbolOrNull(this ITypeSymbol? symbol, string paramName)
410return (TypeSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName);
518returnType = TypeWithAnnotations.Create((TypeSymbol)symbol);
581internal static ITypeSymbol? GetPublicSymbol(this TypeSymbol? symbol)
702internal static ImmutableArray<ITypeSymbol> GetPublicSymbols(this ImmutableArray<TypeSymbol> symbols)
766internal static TypeSymbol? GetSymbol(this ITypeSymbol? symbol)
768return symbol.GetSymbol<TypeSymbol>();
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (12)
18private readonly TypeSymbol _containingType;
21private readonly TypeSymbol _returnType;
23public SynthesizedIntrinsicOperatorSymbol(TypeSymbol leftType, string name, TypeSymbol rightType, TypeSymbol returnType)
49public SynthesizedIntrinsicOperatorSymbol(TypeSymbol container, string name, TypeSymbol returnType)
446TypeSymbol.Equals(_containingType, other._containingType, compareKind) &&
447TypeSymbol.Equals(_returnType, other._returnType, compareKind))
451if (!TypeSymbol.Equals(_parameters[i].Type, other._parameters[i].Type, compareKind))
472TypeSymbol type,
524internal sealed override bool HasAsyncMethodBuilderAttribute(out TypeSymbol builderArgument)
Symbols\TypeSymbol.cs (55)
39internal static readonly ObjectPool<PooledHashSet<TypeSymbol>> AllIgnoreOptionsSetPool = PooledHashSet<TypeSymbol>.CreatePool(SymbolEqualityComparer.AllIgnoreOptions);
53/// <see cref="TypeSymbol.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics"/>
108for (var baseType = this; !ReferenceEquals(baseType, null); baseType = baseType.BaseTypeNoUseSiteDiagnostics)
132public new TypeSymbol OriginalDefinition
140protected virtual TypeSymbol OriginalTypeSymbolDefinition
193internal abstract ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<TypeSymbol> basesBeingResolved = null);
218var current = this;
237internal TypeSymbol EffectiveTypeNoUseSiteDiagnostics
245internal TypeSymbol EffectiveType(ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
253internal bool IsDerivedFrom(TypeSymbol type, TypeCompareKind comparison, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
280internal bool IsEqualToOrDerivedFrom(TypeSymbol type, TypeCompareKind comparison, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
295internal virtual bool Equals(TypeSymbol t2, TypeCompareKind compareKind)
302var t2 = other as TypeSymbol;
344for (var baseType = this; !ReferenceEquals(baseType, null); baseType = baseType.BaseTypeNoUseSiteDiagnostics)
533internal abstract bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes);
635internal abstract bool ApplyNullableTransforms(byte defaultTransformFlag, ImmutableArray<byte> transforms, ref int position, out TypeSymbol result);
637internal abstract TypeSymbol SetNullabilityForReferenceTypes(Func<TypeWithAnnotations, TypeWithAnnotations> transform);
639internal TypeSymbol SetUnknownNullabilityForReferenceTypes()
653internal abstract TypeSymbol MergeEquivalentTypes(TypeSymbol other, VarianceKind variance);
806private static Symbol ComputeImplementationForInterfaceMember(Symbol interfaceMember, TypeSymbol implementingType, BindingDiagnosticBag diagnostics,
837TypeSymbol implementingBaseOpt = null; // Calculated only if canBeImplementedImplicitly == false
842for (TypeSymbol currType = implementingType; (object)currType != null; currType = currType.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteInfo))
1058private static Symbol FindMostSpecificImplementationInInterfaces(Symbol interfaceMember, TypeSymbol implementingType,
1091static bool stopLookup(MethodSymbol interfaceAccessor, TypeSymbol implementingType)
1154TypeSymbol implementingType,
1467private static bool IsExplicitlyImplementedViaAccessors(bool checkPendingExplicitImplementations, Symbol interfaceMember, TypeSymbol currType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol implementingMember)
1504private static bool TryGetExplicitImplementationAssociatedPropertyOrEvent(bool checkPendingExplicitImplementations, MethodSymbol interfaceAccessor, TypeSymbol currType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out Symbol associated)
1548private static void CheckForImplementationOfCorrespondingPropertyOrEvent(MethodSymbol interfaceMethod, TypeSymbol implementingType, bool implementingTypeIsFromSomeCompilation,
1600else if ((object)correspondingImplementingAccessor != null && ((object)implicitImpl == null || TypeSymbol.Equals(correspondingImplementingAccessor.ContainingType, implicitImpl.ContainingType, TypeCompareKind.ConsiderEverything2)))
1631private static void ReportDefaultInterfaceImplementationMatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol implicitImpl, BindingDiagnosticBag diagnostics)
1679private static void ReportImplicitImplementationMatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol implicitImpl, BindingDiagnosticBag diagnostics)
1774internal static void CheckModifierMismatchOnImplementingMember(TypeSymbol implementingType, Symbol implementingMember, Symbol interfaceMember, bool isExplicit, BindingDiagnosticBag diagnostics)
1813TypeSymbol implementingType,
1819ReportMismatchInReturnType<(TypeSymbol implementingType, bool isExplicit)> reportMismatchInReturnType =
1842ReportMismatchInParameterType<(TypeSymbol implementingType, bool isExplicit)> reportMismatchInParameterType =
2008private static void ReportImplicitImplementationMismatchDiagnostics(Symbol interfaceMember, TypeSymbol implementingType, Symbol closestMismatch, BindingDiagnosticBag diagnostics)
2030TypeSymbol interfaceMemberReturnType;
2103private static Location GetInterfaceLocation(Symbol interfaceMember, TypeSymbol implementingType)
2117private static bool ReportAnyMismatchedConstraints(MethodSymbol interfaceMethod, TypeSymbol implementingType, MethodSymbol implicitImpl, BindingDiagnosticBag diagnostics)
2163internal static Location GetImplicitImplementationDiagnosticLocation(Symbol interfaceMember, TypeSymbol implementingType, Symbol member)
2165if (TypeSymbol.Equals(member.ContainingType, implementingType, TypeCompareKind.ConsiderEverything2))
2195TypeSymbol currType,
2479public static bool Equals(TypeSymbol? left, TypeSymbol? right, TypeCompareKind comparison)
2491public static bool operator ==(TypeSymbol left, TypeSymbol right)
2495public static bool operator !=(TypeSymbol left, TypeSymbol right)
2499public static bool operator ==(Symbol left, TypeSymbol right)
2503public static bool operator !=(Symbol left, TypeSymbol right)
2507public static bool operator ==(TypeSymbol left, Symbol right)
2511public static bool operator !=(TypeSymbol left, Symbol right)
Symbols\TypeSymbolExtensions.cs (180)
27public static bool ImplementsInterface(this TypeSymbol subType, TypeSymbol superInterface, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
31if (@interface.IsInterface && TypeSymbol.Equals(@interface, superInterface, TypeCompareKind.ConsiderEverything2))
39public static bool CanBeAssignedNull(this TypeSymbol type)
44public static bool CanContainNull(this TypeSymbol type)
50public static bool CanBeConst(this TypeSymbol typeSymbol)
70public static bool IsTypeParameterDisallowingAnnotationInCSharp8(this TypeSymbol type)
91public static bool IsPossiblyNullableReferenceTypeTypeParameter(this TypeSymbol type)
96public static bool IsNonNullableValueType(this TypeSymbol typeArgument)
106public static bool IsVoidType(this TypeSymbol type)
111public static bool IsNullableTypeOrTypeParameter(this TypeSymbol? type)
140public static bool IsNullableType(this TypeSymbol type)
145public static bool IsValidNullableTypeArgument(this TypeSymbol type)
153public static TypeSymbol GetNullableUnderlyingType(this TypeSymbol type)
158public static bool IsNullableType(this TypeSymbol? type, [NotNullWhen(true)] out TypeSymbol? underlyingType)
171public static TypeWithAnnotations GetNullableUnderlyingTypeWithAnnotations(this TypeSymbol type)
180public static TypeSymbol StrippedType(this TypeSymbol type)
185extension(TypeSymbol patternInputType)
202public static TypeSymbol EnumUnderlyingTypeOrSelf(this TypeSymbol type)
207public static bool IsNativeIntegerOrNullableThereof(this TypeSymbol? type)
212public static bool IsObjectType(this TypeSymbol type)
217public static bool IsStringType(this TypeSymbol type)
222public static bool IsCharType(this TypeSymbol type)
227public static bool IsIntegralType(this TypeSymbol type)
232public static NamedTypeSymbol? GetEnumUnderlyingType(this TypeSymbol? type)
237public static bool IsEnumType(this TypeSymbol type)
243public static bool IsValidEnumType(this TypeSymbol type)
256public static bool IsValidAttributeParameterType(this TypeSymbol type, CSharpCompilation compilation)
267public static TypedConstantKind GetAttributeParameterTypedConstantKind(this TypeSymbol type, CSharpCompilation compilation)
331public static bool IsValidExtensionParameterType(this TypeSymbol type)
344public static bool IsValidInOrRefReadonlyExtensionParameterType(this TypeSymbol type)
349public static bool IsInterfaceType(this TypeSymbol type)
355public static bool IsClassType(this TypeSymbol type)
361public static bool IsStructType(this TypeSymbol type)
367public static bool IsErrorType(this TypeSymbol type)
378public static bool IsDynamic(this TypeSymbol type)
383public static bool IsTypeParameter(this TypeSymbol type)
389public static bool IsArray(this TypeSymbol type)
395public static bool IsSZArray(this TypeSymbol type)
401internal static bool IsArrayInterface(this TypeSymbol type, out TypeWithAnnotations typeArgument)
404internal static bool IsReadOnlyArrayInterface(this TypeSymbol type, out TypeWithAnnotations typeArgument)
422internal static bool IsMutableArrayInterface(this TypeSymbol type, out TypeWithAnnotations typeArgument)
439public static bool IsFunctionPointer(this TypeSymbol type)
444public static bool IsPointerOrFunctionPointer(this TypeSymbol type)
457internal static ImmutableArray<NamedTypeSymbol> GetAllInterfacesOrEffectiveInterfaces(this TypeSymbol type)
478public static NamedTypeSymbol? GetDelegateType(this TypeSymbol? type)
489public static TypeSymbol? GetDelegateOrFunctionPointerType(this TypeSymbol? type)
491return (TypeSymbol?)GetDelegateType(type) ?? type as FunctionPointerTypeSymbol;
498public static bool IsExpressionTree(this TypeSymbol type)
507public static bool IsNonGenericExpressionType(this TypeSymbol type)
517public static bool IsGenericOrNonGenericExpressionType(this TypeSymbol _type, out bool isGenericType)
557public static bool IsPossibleArrayGenericInterface(this TypeSymbol type)
580internal static bool IsErrorOrRefLikeOrAllowsRefLikeType(this TypeSymbol type)
585internal static bool IsRefLikeOrAllowsRefLikeType(this TypeSymbol type)
608public static bool IsDelegateType(this TypeSymbol type)
614public static ImmutableArray<ParameterSymbol> DelegateParameters(this TypeSymbol type)
624public static ImmutableArray<ParameterSymbol> DelegateOrFunctionPointerParameters(this TypeSymbol type)
637public static bool TryGetElementTypesWithAnnotationsIfTupleType(this TypeSymbol type, out ImmutableArray<TypeWithAnnotations> elementTypes)
650public static MethodSymbol? DelegateInvokeMethod(this TypeSymbol type)
661public static ConstantValue? GetDefaultValue(this TypeSymbol type)
709public static SpecialType GetSpecialTypeSafe(this TypeSymbol? type)
714public static bool IsAtLeastAsVisibleAs(this TypeSymbol type, Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
719public static TypeSymbol? FindTypeLessVisibleThan(this TypeSymbol type, Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
728var result = type.VisitType(static (type1, arg, unused) => IsTypeLessVisibleThan(type1, arg.Symbol!, ref arg.UseSiteInfo),
743private static bool IsTypeLessVisibleThan(TypeSymbol type, Symbol sym, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
767public static TypeSymbol? VisitType<T>(
768this TypeSymbol type,
769Func<TypeSymbol, T, bool, bool> predicate,
795public static TypeSymbol? VisitType<T>(
797TypeSymbol? type,
799Func<TypeSymbol, T, bool, bool>? typePredicate,
816TypeSymbol current = type ?? (useDefaultType ? typeWithAnnotationsOpt.DefaultType : typeWithAnnotationsOpt.Type);
832var result = VisitType(default, containingType, typeWithAnnotationsPredicate, typePredicate, arg, canDigThroughNullable, useDefaultType, visitCustomModifiers);
865var result = VisitType(
916(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(fields[i].TypeWithAnnotations, canDigThroughNullable);
917var result = VisitType(
947(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(typeArguments[i], canDigThroughNullable);
948var result = VisitType(
978var result = visitFunctionPointerType((FunctionPointerTypeSymbol)current, typeWithAnnotationsPredicate, typePredicate, arg, useDefaultType, canDigThroughNullable, visitCustomModifiers, out next);
996static (TypeWithAnnotations, TypeSymbol?) getNextIterationElements(TypeWithAnnotations type, bool canDigThroughNullable)
999static TypeSymbol? visitFunctionPointerType(FunctionPointerTypeSymbol type, Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, Func<TypeSymbol, T, bool, bool>? typePredicate, T arg, bool useDefaultType, bool canDigThroughNullable, bool visitCustomModifiers, out TypeWithAnnotations next)
1008var result = VisitType(
1026(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(currentPointer.Parameters[i].TypeWithAnnotations, canDigThroughNullable);
1228public static bool IsUnboundGenericType(this TypeSymbol type)
1244public static bool ContainsTypeParameter(this TypeSymbol type, TypeParameterSymbol? parameter = null)
1246var result = type.VisitType(s_containsTypeParameterPredicate, parameter);
1250private static readonly Func<TypeSymbol, TypeParameterSymbol?, bool, bool> s_containsTypeParameterPredicate =
1251(type, parameter, unused) => type.TypeKind == TypeKind.TypeParameter && (parameter is null || TypeSymbol.Equals(type, parameter, TypeCompareKind.ConsiderEverything2));
1253public static bool ContainsTypeParameter(this TypeSymbol type, Symbol typeParameterContainer)
1257var result = type.VisitType(s_isTypeParameterWithSpecificContainerPredicate, typeParameterContainer);
1261private static readonly Func<TypeSymbol, Symbol, bool, bool> s_isTypeParameterWithSpecificContainerPredicate =
1264public static bool ContainsTypeParameters(this TypeSymbol type, HashSet<TypeParameterSymbol> parameters)
1266var result = type.VisitType(s_containsTypeParametersPredicate, parameters);
1270private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_containsTypeParametersPredicate =
1273public static bool ContainsAdditionalTypeParameter(this TypeSymbol type, HashSet<TypeParameterSymbol> allowedTypeParameters)
1275var result = type.VisitType(
1280public static void FindTypeParameters(this TypeSymbol type, HashSet<TypeParameterSymbol> result)
1301private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_typeParameterSymbolCollector = (typeSymbol, result, _) =>
1311public static bool ContainsMethodTypeParameter(this TypeSymbol type)
1313var result = type.VisitType(s_containsMethodTypeParameterPredicate, null);
1317private static readonly Func<TypeSymbol, object?, bool, bool> s_containsMethodTypeParameterPredicate =
1323public static bool ContainsDynamic(this TypeSymbol type)
1325var result = type.VisitType(s_containsDynamicPredicate, null, canDigThroughNullable: true);
1329private static readonly Func<TypeSymbol, object?, bool, bool> s_containsDynamicPredicate = (type, unused1, unused2) => type.TypeKind == TypeKind.Dynamic;
1331internal static bool ContainsNativeIntegerWrapperType(this TypeSymbol type)
1333var result = type.VisitType((type, unused1, unused2) => type.IsNativeIntegerWrapperType, (object?)null, canDigThroughNullable: true);
1342internal static bool ContainsErrorType(this TypeSymbol type)
1344var result = type.VisitType((type, unused1, unused2) => type.IsErrorType(), (object?)null, canDigThroughNullable: true);
1351internal static bool ContainsTuple(this TypeSymbol type) =>
1352type.VisitType((TypeSymbol t, object? _1, bool _2) => t.IsTupleType, null) is object;
1357internal static bool ContainsTupleNames(this TypeSymbol type) =>
1358type.VisitType((TypeSymbol t, object? _1, bool _2) => !t.TupleElementNames.IsDefault, null) is object;
1363internal static bool ContainsFunctionPointer(this TypeSymbol type) =>
1364type.VisitType((TypeSymbol t, object? _, bool _) => t.IsFunctionPointer(), null) is object;
1366internal static bool ContainsPointerOrFunctionPointer(this TypeSymbol type) =>
1367type.VisitType((TypeSymbol t, object? _, bool _) => t.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer, null) is object;
1384internal static TypeSymbol? GetNonErrorGuess(this TypeSymbol type)
1386var result = ExtendedErrorTypeSymbol.ExtractNonErrorType(type);
1395internal static TypeKind GetNonErrorTypeKindGuess(this TypeSymbol type)
1405internal static bool IsValidV6SwitchGoverningType(this TypeSymbol type, bool isTargetTypeOfUserDefinedOp = false)
1450internal static bool IsSpan(this TypeSymbol type)
1463internal static bool IsReadOnlySpan(this TypeSymbol type)
1476internal static bool IsSpanChar(this TypeSymbol type)
1487internal static bool IsReadOnlySpanChar(this TypeSymbol type)
1498internal static bool IsSpanOrReadOnlySpanChar(this TypeSymbol type)
1516internal static bool IsRestrictedType(this TypeSymbol type,
1532public static bool IsIntrinsicType(this TypeSymbol type)
1559public static bool IsPartial(this TypeSymbol type)
1564public static bool HasFileLocalTypes(this TypeSymbol type)
1566var foundType = type.VisitType(predicate: (type, _, _) => type is NamedTypeSymbol { IsFileLocal: true }, arg: (object?)null);
1579public static bool IsPointerType(this TypeSymbol type)
1584internal static int FixedBufferElementSizeInBytes(this TypeSymbol type)
1590internal static bool IsValidVolatileFieldType(this TypeSymbol type)
1624public static bool MarkCheckedIfNecessary(this TypeSymbol type, ref HashSet<TypeSymbol> checkedTypes)
1628checkedTypes = new HashSet<TypeSymbol>();
1634internal static bool IsVoidPointer(this TypeSymbol type)
1643internal static bool IsPrimitiveRecursiveStruct(this TypeSymbol t)
1727public static TypeSymbol AsDynamicIfNoPia(this TypeSymbol type, NamedTypeSymbol containingType)
1729return type.TryAsDynamicIfNoPia(containingType, out TypeSymbol? result) ? result : type;
1732public static bool TryAsDynamicIfNoPia(this TypeSymbol type, NamedTypeSymbol containingType, [NotNullWhen(true)] out TypeSymbol? result)
1752internal static bool IsVerifierReference(this TypeSymbol type)
1760internal static bool IsVerifierValue(this TypeSymbol type)
1912internal static bool IsNonGenericTaskType(this TypeSymbol type, CSharpCompilation compilation)
1930internal static bool IsGenericTaskType(this TypeSymbol type, CSharpCompilation compilation)
1943internal static bool IsIAsyncEnumerableType(this TypeSymbol type, CSharpCompilation compilation)
1953internal static bool IsIAsyncEnumeratorType(this TypeSymbol type, CSharpCompilation compilation)
1973internal static bool IsCustomTaskType(this NamedTypeSymbol type, [NotNullWhen(true)] out TypeSymbol? builderArgument)
1990internal static TypeSymbol NormalizeTaskTypes(this TypeSymbol type, CSharpCompilation compilation)
1999private static bool NormalizeTaskTypesInType(CSharpCompilation compilation, ref TypeSymbol type)
2038var type = typeWithAnnotations.Type;
2060var typeArgNormalized = typeWithModifier.Type;
2203internal static bool IsWellKnownTypeInAttribute(this TypeSymbol typeSymbol)
2206internal static bool IsWellKnownTypeRequiresLocationAttribute(this TypeSymbol typeSymbol)
2209internal static bool IsWellKnownTypeUnmanagedType(this TypeSymbol typeSymbol)
2212internal static bool IsWellKnownTypeIsExternalInit(this TypeSymbol typeSymbol)
2215internal static bool IsWellKnownTypeOutAttribute(this TypeSymbol typeSymbol) => typeSymbol.IsWellKnownInteropServicesTopLevelType("OutAttribute");
2218internal static bool IsWellKnownTypeLock(this TypeSymbol typeSymbol)
2224internal static bool IsMicrosoftCodeAnalysisEmbeddedAttribute(this TypeSymbol typeSymbol)
2235private static bool IsWellKnownInteropServicesTopLevelType(this TypeSymbol typeSymbol, string name)
2245private static bool IsWellKnownCompilerServicesTopLevelType(this TypeSymbol typeSymbol, string name)
2255internal static bool IsCompilerServicesTopLevelType(this TypeSymbol typeSymbol)
2258internal static bool IsWellKnownSetsRequiredMembersAttribute(this TypeSymbol type)
2261internal static bool IsWellKnownINumberBaseType(this TypeSymbol type)
2268internal static bool IsWellKnownDiagnosticsCodeAnalysisTopLevelType(this TypeSymbol typeSymbol)
2271private static bool IsContainedInNamespace(this TypeSymbol typeSymbol, string outerNS, string midNS, string? innerNS = null)
2304internal static int TypeToIndex(this TypeSymbol type)
2329TypeSymbol underlyingType = type.GetNullableUnderlyingType();
2358internal static bool IsDisplayClassType(this TypeSymbol type)
Symbols\TypeUnification.cs (12)
18public static bool CanUnify(TypeSymbol t1, TypeSymbol t2)
31Debug.Assert(TypeSymbol.Equals(candidateBaseType.OriginalDefinition, closedType.OriginalDefinition, TypeCompareKind.CLRSignatureCompareOptions));
39private static bool CanUnify(TypeSymbol t1, TypeSymbol t2, out MutableTypeMap? substitution)
42if (TypeSymbol.Equals(t1, t2, TypeCompareKind.CLRSignatureCompareOptions))
76private static bool CanUnifyHelper(TypeSymbol t1, TypeSymbol t2, ref MutableTypeMap? substitution)
111if (TypeSymbol.Equals(t1.Type, t2.Type, TypeCompareKind.CLRSignatureCompareOptions) && t1.CustomModifiers.SequenceEqual(t2.CustomModifiers))
179if (nt2.Arity != arity || !TypeSymbol.Equals(nt2.OriginalDefinition, nt1.OriginalDefinition, TypeCompareKind.ConsiderEverything))
284private static bool Contains(TypeSymbol type, TypeParameterSymbol typeParam)
312return TypeSymbol.Equals(type, typeParam, TypeCompareKind.ConsiderEverything);
Symbols\TypeWithAnnotations.cs (90)
40internal readonly TypeSymbol DefaultType;
53private TypeWithAnnotations(TypeSymbol defaultType, NullableAnnotation defaultAnnotation, Extensions extensions)
75internal static TypeWithAnnotations Create(bool isNullableEnabled, TypeSymbol typeSymbol, bool isAnnotated = false)
85internal static TypeWithAnnotations Create(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation = NullableAnnotation.Oblivious, ImmutableArray<CustomModifier> customModifiers = default)
168private static TypeWithAnnotations CreateNonLazyType(TypeSymbol typeSymbol, NullableAnnotation nullableAnnotation, ImmutableArray<CustomModifier> customModifiers)
178private static TypeWithAnnotations CreateLazySubstitutedType(TypeSymbol substitutedTypeSymbol, ImmutableArray<CustomModifier> customModifiers, TypeParameterSymbol typeParameter)
198var typeSymbol = this.Type;
243TypeSymbol typeSymbol = other.Type;
245TypeSymbol type = Type.MergeEquivalentTypes(typeSymbol, variance);
254public TypeSymbol Type => _extensions?.GetResolvedType(DefaultType);
256public TypeSymbol NullableUnderlyingTypeOrSelf => _extensions.GetNullableUnderlyingTypeOrSelf(DefaultType);
377TypeSymbol type = Type;
424public bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
445TypeSymbol typeSymbol = this.Type;
556public TypeSymbol AsTypeSymbolOnly() => _extensions.AsTypeSymbolOnly(DefaultType);
567public TypeWithAnnotations WithTypeAndModifiers(TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers) =>
570public TypeWithAnnotations WithType(TypeSymbol typeSymbol) =>
591TypeSymbol typeOpt)
593var type = TypeSymbolExtensions.VisitType(
606private static bool IsNonGenericValueType(TypeSymbol type)
629var type = typeWithAnnotations.Type;
665TypeSymbol oldTypeSymbol = Type;
687TypeSymbol newTypeSymbol;
726var typeSymbol = Type;
737var typeSymbol = Type;
738var newTypeSymbol = typeSymbol.SetUnknownNullabilityForReferenceTypes();
813static NullableFlowState getFlowState(TypeSymbol type, NullableAnnotation annotation)
852internal abstract TypeSymbol GetResolvedType(TypeSymbol defaultType);
861internal abstract TypeSymbol GetNullableUnderlyingTypeOrSelf(TypeSymbol typeSymbol);
863internal abstract TypeSymbol AsTypeSymbolOnly(TypeSymbol typeSymbol);
865internal abstract SpecialType GetSpecialType(TypeSymbol typeSymbol);
866internal abstract bool IsRestrictedType(TypeSymbol typeSymbol, bool ignoreSpanLikeTypes);
867internal abstract bool IsStatic(TypeSymbol typeSymbol);
868internal abstract bool IsVoid(TypeSymbol typeSymbol);
869internal abstract bool IsSZArray(TypeSymbol typeSymbol);
870internal abstract bool IsRefLikeType(TypeSymbol typeSymbol);
871internal abstract bool IsRefLikeOrAllowsRefLikeType(TypeSymbol typeSymbol);
873internal abstract TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers);
893internal override TypeSymbol GetResolvedType(TypeSymbol defaultType) => defaultType;
897internal override SpecialType GetSpecialType(TypeSymbol typeSymbol) => typeSymbol.SpecialType;
898internal override bool IsRestrictedType(TypeSymbol typeSymbol, bool ignoreSpanLikeTypes) => typeSymbol.IsRestrictedType(ignoreSpanLikeTypes);
899internal override bool IsStatic(TypeSymbol typeSymbol) => typeSymbol.IsStatic;
900internal override bool IsVoid(TypeSymbol typeSymbol) => typeSymbol.IsVoidType();
901internal override bool IsSZArray(TypeSymbol typeSymbol) => typeSymbol.IsSZArray();
902internal override bool IsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.IsRefLikeType;
903internal override bool IsRefLikeOrAllowsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.IsRefLikeOrAllowsRefLikeType();
905internal override TypeSymbol GetNullableUnderlyingTypeOrSelf(TypeSymbol typeSymbol) => typeSymbol.StrippedType();
912internal override TypeSymbol AsTypeSymbolOnly(TypeSymbol typeSymbol) => typeSymbol;
914internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers)
926var defaultType = type.DefaultType;
970internal override SpecialType GetSpecialType(TypeSymbol typeSymbol) => typeSymbol.SpecialType;
971internal override bool IsRestrictedType(TypeSymbol typeSymbol, bool ignoreSpanLikeTypes) => typeSymbol.IsRestrictedType(ignoreSpanLikeTypes);
972internal override bool IsStatic(TypeSymbol typeSymbol) => typeSymbol.IsStatic;
973internal override bool IsVoid(TypeSymbol typeSymbol) => typeSymbol.IsVoidType();
974internal override bool IsSZArray(TypeSymbol typeSymbol) => typeSymbol.IsSZArray();
975internal override bool IsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.IsRefLikeType;
976internal override bool IsRefLikeOrAllowsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.IsRefLikeOrAllowsRefLikeType();
1006internal override TypeSymbol GetNullableUnderlyingTypeOrSelf(TypeSymbol typeSymbol) => typeSymbol.StrippedType();
1007internal override TypeSymbol AsTypeSymbolOnly(TypeSymbol typeSymbol) => typeSymbol;
1009internal override TypeSymbol GetResolvedType(TypeSymbol defaultType) => defaultType;
1017internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers)
1029var defaultType = type.DefaultType;
1063private TypeSymbol _resolved;
1074internal override bool IsVoid(TypeSymbol typeSymbol) => false;
1075internal override bool IsSZArray(TypeSymbol typeSymbol) => false;
1076internal override bool IsRefLikeType(TypeSymbol typeSymbol) => false;
1077internal override bool IsRefLikeOrAllowsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.IsRefLikeOrAllowsRefLikeType();
1078internal override bool IsStatic(TypeSymbol typeSymbol) => false;
1080private TypeSymbol GetResolvedType()
1090internal override TypeSymbol GetNullableUnderlyingTypeOrSelf(TypeSymbol typeSymbol) => _underlying.Type;
1092internal override SpecialType GetSpecialType(TypeSymbol typeSymbol)
1098internal override bool IsRestrictedType(TypeSymbol typeSymbol, bool ignoreSpanLikeTypes) => _underlying.IsRestrictedType(ignoreSpanLikeTypes);
1100internal override TypeSymbol AsTypeSymbolOnly(TypeSymbol typeSymbol)
1102var resolvedType = GetResolvedType();
1108internal override TypeSymbol GetResolvedType(TypeSymbol defaultType) => GetResolvedType();
1119var resolvedType = GetResolvedType();
1128internal override TypeWithAnnotations WithTypeAndModifiers(TypeWithAnnotations type, TypeSymbol typeSymbol, ImmutableArray<CustomModifier> customModifiers)
1202var resolved = asValueType ?
Utilities\TypeUnionValueSet.cs (19)
29internal readonly struct CaseInfo(TypeSymbol caseType, TypeSymbol? originalClosedBase)
31internal readonly TypeSymbol CaseType = caseType;
34internal readonly TypeSymbol? OriginalClosedBase = originalClosedBase;
79internal static TypeUnionValueSet FromTypeMatch(ImmutableArray<CaseInfo> typesInUnion, TypeSymbol type, ConversionsBase conversions, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
90private static bool AnyTypeFromUnionMightMatch(ImmutableArray<CaseInfo> typesInUnion, TypeSymbol type, ConversionsBase conversions, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
181private bool? EvaluateNodeForInputValue(Node node, TypeSymbol? inputValue, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
195case TypeSymbol t1:
211case TypeSymbol:
245bool? evaluateTypeMatch(TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
265public TypeSymbol? SampleType(Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
278static TypeSymbol? walkUpInvalidClosedSubtypesIfNeeded(TypeSymbol? sampleType, TypeSymbol? originalClosedBase, Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
291static bool isInvalidClosedSubtype(NamedTypeSymbol possibleClosedSubtype, TypeSymbol originalClosedBase, Binder binder, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
408public bool TypeMatchesAllValuesIfAny(TypeSymbol type, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
462private sealed class IsTypeNode(TypeSymbol type) : Node
464public TypeSymbol Type { get; } = type;
Utilities\ValueSetFactory.ClosedClassTypeUnionValueSetFactory.cs (7)
25internal static void ExpandClosedSubtypes(TypeSymbol possibleClosedClass, ArrayBuilder<TypeUnionValueSet.CaseInfo> builder, HashSet<TypeSymbol> setBuilder)
36private static void ExpandClosedSubtypesCore(ImmutableArray<NamedTypeSymbol> subtypes, NamedTypeSymbol originalBase, ArrayBuilder<TypeUnionValueSet.CaseInfo> builder, HashSet<TypeSymbol> setBuilder)
52private static void AddCaseInfo(ArrayBuilder<TypeUnionValueSet.CaseInfo> builder, HashSet<TypeSymbol> setBuilder, TypeSymbol caseType, NamedTypeSymbol? originalClosedBase)
65var setBuilder = TypeSymbol.AllIgnoreOptionsSetPool.Allocate();
76public TypeUnionValueSet FromTypeMatch(TypeSymbol type, ConversionsBase conversions, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)