using System; using System.Collections.Immutable; using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.Operations; using Microsoft.CodeAnalysis.PooledObjects; namespace Microsoft.CodeAnalysis.CSharp; internal sealed class BoundCall : BoundExpression, IBoundInvalidNode { public override Symbol ExpressionSymbol => Method; ImmutableArray IBoundInvalidNode.InvalidNodeChildren => CSharpOperationFactory.CreateInvalidChildrenFromArgumentsExpression(ReceiverOpt, Arguments); public new TypeSymbol Type => base.Type; public BoundExpression? ReceiverOpt { get; } public ThreeState InitialBindingReceiverIsSubjectToCloning { get; } public MethodSymbol Method { get; } public ImmutableArray Arguments { get; } public ImmutableArray ArgumentNamesOpt { get; } public ImmutableArray ArgumentRefKindsOpt { get; } public bool IsDelegateCall { get; } public bool Expanded { get; } public bool InvokedAsExtensionMethod { get; } public ImmutableArray ArgsToParamsOpt { get; } public BitVector DefaultArguments { get; } public override LookupResultKind ResultKind { get; } public ImmutableArray OriginalMethodsOpt { get; } public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) : this(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, default(ImmutableArray), type, hasErrors) { }//IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, TypeSymbol type) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return Update(receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, OriginalMethodsOpt, type); } public static BoundCall ErrorCall(SyntaxNode node, BoundExpression receiverOpt, MethodSymbol method, ImmutableArray arguments, ImmutableArray namedArguments, ImmutableArray refKinds, bool isDelegateCall, bool invokedAsExtensionMethod, ImmutableArray originalMethods, LookupResultKind resultKind, Binder binder) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!originalMethods.IsEmpty) { resultKind = resultKind.WorseResultKind(LookupResultKind.OverloadResolutionFailure); } return new BoundCall(node, binder.BindToTypeForErrorRecovery(receiverOpt), (ThreeState)1, method, ImmutableArrayExtensions.SelectAsArray(arguments, (Func)((BoundExpression e, Binder binder2) => binder2.BindToTypeForErrorRecovery(e)), binder), namedArguments, refKinds, isDelegateCall, expanded: false, invokedAsExtensionMethod, default(ImmutableArray), default(BitVector), resultKind, originalMethods, method.ReturnType, hasErrors: true); } public BoundCall Update(ImmutableArray arguments) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) return Update(ReceiverOpt, InitialBindingReceiverIsSubjectToCloning, Method, arguments, ArgumentNamesOpt, ArgumentRefKindsOpt, IsDelegateCall, Expanded, InvokedAsExtensionMethod, ArgsToParamsOpt, DefaultArguments, ResultKind, OriginalMethodsOpt, Type); } public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) return Update(receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, ArgumentNamesOpt, ArgumentRefKindsOpt, IsDelegateCall, Expanded, InvokedAsExtensionMethod, ArgsToParamsOpt, DefaultArguments, ResultKind, OriginalMethodsOpt, Type); } public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Synthesized(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, ImmutableArray.Empty); } public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Synthesized(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, ImmutableArray.Create(arg0)); } public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0, BoundExpression arg1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Synthesized(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, ImmutableArray.Create(arg0, arg1)); } public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentRefKindsOpt = default(ImmutableArray)) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) argumentRefKindsOpt = (argumentRefKindsOpt.IsDefault ? getArgumentRefKinds(method) : argumentRefKindsOpt); return new BoundCall(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, default(ImmutableArray), argumentRefKindsOpt, isDelegateCall: false, expanded: false, invokedAsExtensionMethod: false, default(ImmutableArray), default(BitVector), LookupResultKind.Viable, default(ImmutableArray), method.ReturnType, method.OriginalDefinition is ErrorMethodSymbol) { WasCompilerGenerated = true }; static ImmutableArray getArgumentRefKinds(MethodSymbol methodSymbol) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) ImmutableArray parameterRefKinds = methodSymbol.ParameterRefKinds; if (!parameterRefKinds.IsDefaultOrEmpty && parameterRefKinds.Contains((RefKind)4)) { ArrayBuilder instance = ArrayBuilder.GetInstance(parameterRefKinds.Length); ImmutableArray.Enumerator enumerator = parameterRefKinds.GetEnumerator(); while (enumerator.MoveNext()) { RefKind current = enumerator.Current; instance.Add((RefKind)(((int)current == 4) ? 3 : ((int)current))); } return instance.ToImmutableAndFree(); } return parameterRefKinds; } } public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray originalMethodsOpt, TypeSymbol type, bool hasErrors = false) : base(BoundKind.Call, syntax, type, hasErrors || receiverOpt.HasErrors() || arguments.HasErrors()) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) ReceiverOpt = receiverOpt; InitialBindingReceiverIsSubjectToCloning = initialBindingReceiverIsSubjectToCloning; Method = method; Arguments = arguments; ArgumentNamesOpt = argumentNamesOpt; ArgumentRefKindsOpt = argumentRefKindsOpt; IsDelegateCall = isDelegateCall; Expanded = expanded; InvokedAsExtensionMethod = invokedAsExtensionMethod; ArgsToParamsOpt = argsToParamsOpt; DefaultArguments = defaultArguments; ResultKind = resultKind; OriginalMethodsOpt = originalMethodsOpt; } [DebuggerStepThrough] public override BoundNode? Accept(BoundTreeVisitor visitor) { return visitor.VisitCall(this); } public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray originalMethodsOpt, TypeSymbol type) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (receiverOpt != ReceiverOpt || initialBindingReceiverIsSubjectToCloning != InitialBindingReceiverIsSubjectToCloning || !SymbolEqualityComparer.ConsiderEverything.Equals(method, Method) || arguments != Arguments || argumentNamesOpt != ArgumentNamesOpt || argumentRefKindsOpt != ArgumentRefKindsOpt || isDelegateCall != IsDelegateCall || expanded != Expanded || invokedAsExtensionMethod != InvokedAsExtensionMethod || argsToParamsOpt != ArgsToParamsOpt || defaultArguments != DefaultArguments || resultKind != ResultKind || originalMethodsOpt != OriginalMethodsOpt || !TypeSymbol.Equals(type, Type, (TypeCompareKind)0)) { BoundCall boundCall = new BoundCall(Syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, originalMethodsOpt, type, base.HasErrors); boundCall.CopyAttributes(this); return boundCall; } return this; } }