1 write to Method
Microsoft.CodeAnalysis.CSharp (1)
Binder\MethodArgumentInfo.cs (1)
28this.Method = method;
52 references to Method
Microsoft.CodeAnalysis.CSharp (52)
Binder\ForEachLoopBinder.cs (18)
234MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo?.Method; 255var placeholder = new BoundAwaitableValuePlaceholder(expr, builder.MoveNextInfo?.Method.ReturnType ?? CreateErrorType()); 461ReportDiagnosticsIfObsolete(diagnostics, builder.MoveNextInfo.Method, foreachKeyword, hasBaseReceiver: false); 571builder.GetEnumeratorInfo.Method.IsExtensionMethod)) || 597: builder.PatternDisposeInfo.Method.ReturnType; 862Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod); 909Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod); 1020Debug.Assert(!(viaExtensionMethod && builder.GetEnumeratorInfo.Method.Parameters.IsDefaultOrEmpty)); 1024? builder.GetEnumeratorInfo.Method.Parameters[0].Type 1036MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo.Method; 1166builder.GetEnumeratorInfo.Method.ReturnType.SpecialType == SpecialType.System_Collections_IEnumerator); 1192TypeSymbol enumeratorType = builder.GetEnumeratorInfo.Method.ReturnType; 1305TypeSymbol.Equals(builder.GetEnumeratorInfo.Method.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2)); 1594Debug.Assert((object)builder.GetEnumeratorInfo.Method != null); 1596MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo.Method; 1682moveNextMethodCandidate.Method.IsStatic || moveNextMethodCandidate.Method.DeclaredAccessibility != Accessibility.Public || 1683IsInvalidMoveNextMethod(moveNextMethodCandidate.Method, isAsync))
Binder\RefSafetyAnalysis.cs (1)
1055resultType: node.EnumeratorInfoOpt.GetEnumeratorInfo.Method.ContainingType,
Compilation\MemberSemanticModel.cs (3)
974if (enumeratorInfoOpt.PatternDisposeInfo is { Method: var method }) 988enumeratorInfoOpt.GetEnumeratorInfo.Method.GetPublicSymbol(), 989enumeratorInfoOpt.MoveNextInfo.Method.GetPublicSymbol(),
FlowAnalysis\NullableWalker.cs (7)
6682if (node is BoundForEachStatement { EnumeratorInfoOpt: { GetEnumeratorInfo: { Method: { TypeArgumentsWithAnnotations: { IsEmpty: false } } } } }) 10900if (enumeratorInfoOpt?.GetEnumeratorInfo is { Method: { IsExtensionMethod: true, Parameters: var parameters } } enumeratorMethodInfo) 10915enumeratorMethodInfo.Method); 10967bool reportedDiagnostic = enumeratorInfoOpt?.GetEnumeratorInfo.Method is { IsExtensionMethod: true } 11011reinferredGetEnumeratorMethod = (MethodSymbol)AsMemberOfType(getEnumeratorType, enumeratorInfoOpt.GetEnumeratorInfo.Method); 11033var moveNextAsyncMethod = (MethodSymbol)AsMemberOfType(reinferredGetEnumeratorMethod.ReturnType, enumeratorInfoOpt.MoveNextInfo.Method); 11046if (enumeratorInfoOpt.PatternDisposeInfo is { Method: var originalDisposeMethod }) // no statically known Dispose method if doing a runtime check
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
234if (enumeratorInfo.GetEnumeratorInfo.Method.IsExtensionMethod)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (2)
178if (!ShouldUseAddRangeOrToListMethod(singleSpread.Expression.Type, toListOfElementType.Parameters[0].Type, singleSpread.EnumeratorInfoOpt?.GetEnumeratorInfo.Method)) 1138if (!ShouldUseAddRangeOrToListMethod(rewrittenSpreadOperand.Type, addRangeMethod.Parameters[0].Type, spreadElement.EnumeratorInfoOpt?.GetEnumeratorInfo.Method))
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (7)
154TypeSymbol enumeratorType = getEnumeratorInfo.Method.ReturnType; 162var receiver = ConvertReceiverForInvocation(forEachSyntax, rewrittenExpression, getEnumeratorInfo.Method, convertedCollection.Conversion, enumeratorInfo.CollectionType); 167if (getEnumeratorInfo.Method.IsExtensionMethod) 174getEnumeratorInfo.Method, 184allowExtensionAndOptionalParameters: isAsync || getEnumeratorInfo.Method.IsExtensionMethod, firstRewrittenArgument: firstRewrittenArgument); 324MethodSymbol? disposeMethod = enumeratorInfo.PatternDisposeInfo?.Method; // pattern-based 548return BoundCall.Synthesized(syntax, receiver, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, methodArgumentInfo.Method, arguments: ImmutableArray<BoundExpression>.Empty);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (2)
445MethodSymbol? disposeMethod = disposeInfo?.Method; 494MethodSymbol method = methodArgumentInfo.Method;
Operations\CSharpOperationFactory.cs (11)
1902enumeratorInfoOpt.GetEnumeratorInfo.Method.GetPublicSymbol(), 1904enumeratorInfoOpt.MoveNextInfo.Method.GetPublicSymbol(), 1911HasImplicitConversionToOrImplementsVarianceCompatibleInterface(enumeratorInfoOpt.GetEnumeratorInfo.Method.ReturnType, 1916enumeratorInfoOpt.PatternDisposeInfo?.Method.GetPublicSymbol(), 1943info.Method, 1947invokedAsExtensionMethod: info.Method.IsExtensionMethod 2039disposeMethod: boundUsingStatement.PatternDisposeInfoOpt.Method.GetPublicSymbol(), 2178disposeMethod: usingDecl.PatternDisposeInfoOpt.Method.GetPublicSymbol(), 2943Debug.Assert(!patternDisposeInfo.Method.IsStatic); 2945if (patternDisposeInfo.Method.ParameterCount == 0) 2951patternDisposeInfo.Method,