1 write to Method
Microsoft.CodeAnalysis.CSharp (1)
Binder\MethodArgumentInfo.cs (1)
28
this.
Method
= method;
60 references to Method
Microsoft.CodeAnalysis.CSharp (60)
Binder\ForEachLoopBinder.cs (27)
234
MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo?.
Method
;
263
var placeholder = new BoundAwaitableValuePlaceholder(expr, builder.MoveNextInfo?.
Method
.ReturnType ?? CreateErrorType());
473
ReportDiagnosticsIfObsolete(diagnostics, builder.MoveNextInfo.
Method
, foreachKeyword, hasBaseReceiver: false);
476
Debug.Assert(!IsDisallowedExtensionInOlderLangVer(builder.MoveNextInfo.
Method
));
585
builder.GetEnumeratorInfo.
Method
.IsExtensionMethod ||
586
builder.GetEnumeratorInfo.
Method
.GetIsNewExtensionMember())) ||
612
: builder.PatternDisposeInfo.
Method
.ReturnType;
877
Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.
Method
.IsExtensionMethod || builder.GetEnumeratorInfo.
Method
.GetIsNewExtensionMember());
924
Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.
Method
.IsExtensionMethod || builder.GetEnumeratorInfo.
Method
.GetIsNewExtensionMember());
1035
Debug.Assert(!(viaExtensionMethod && builder.GetEnumeratorInfo.
Method
.IsExtensionMethod && builder.GetEnumeratorInfo.
Method
.Parameters.IsDefaultOrEmpty));
1036
Debug.Assert(!(viaExtensionMethod && !builder.GetEnumeratorInfo.
Method
.IsExtensionMethod && !builder.GetEnumeratorInfo.
Method
.GetIsNewExtensionMember()));
1042
if (builder.GetEnumeratorInfo.
Method
.IsExtensionMethod)
1044
builder.CollectionType = builder.GetEnumeratorInfo.
Method
.Parameters[0].Type;
1048
builder.CollectionType = builder.GetEnumeratorInfo.
Method
.ContainingType.ExtensionParameter.Type;
1065
MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo.
Method
;
1195
builder.GetEnumeratorInfo.
Method
.ReturnType.SpecialType == SpecialType.System_Collections_IEnumerator);
1221
TypeSymbol enumeratorType = builder.GetEnumeratorInfo.
Method
.ReturnType;
1334
TypeSymbol.Equals(builder.GetEnumeratorInfo.
Method
.ReturnType, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
1645
Debug.Assert((object)builder.GetEnumeratorInfo.
Method
!= null);
1647
MethodSymbol getEnumeratorMethod = builder.GetEnumeratorInfo.
Method
;
1733
moveNextMethodCandidate.
Method
.IsStatic || moveNextMethodCandidate.
Method
.DeclaredAccessibility != Accessibility.Public ||
1734
IsInvalidMoveNextMethod(moveNextMethodCandidate.
Method
, isAsync))
Binder\RefSafetyAnalysis.cs (1)
1119
resultType: node.EnumeratorInfoOpt.GetEnumeratorInfo.
Method
.ContainingType,
Compilation\MemberSemanticModel.cs (3)
975
if (enumeratorInfoOpt.PatternDisposeInfo is {
Method
: var method })
989
enumeratorInfoOpt.GetEnumeratorInfo.
Method
.GetPublicSymbol(),
990
enumeratorInfoOpt.MoveNextInfo.
Method
.GetPublicSymbol(),
FlowAnalysis\NullableWalker.cs (7)
7102
if (node is BoundForEachStatement { EnumeratorInfoOpt: { GetEnumeratorInfo: {
Method
: { TypeArgumentsWithAnnotations: { IsEmpty: false } } } } })
11589
if (enumeratorInfoOpt?.GetEnumeratorInfo is {
Method
: { IsExtensionMethod: true, Parameters: var parameters } } enumeratorMethodInfo) // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
11604
enumeratorMethodInfo.
Method
);
11656
bool reportedDiagnostic = enumeratorInfoOpt?.GetEnumeratorInfo.
Method
is { IsExtensionMethod: true } // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
11700
reinferredGetEnumeratorMethod = (MethodSymbol)AsMemberOfType(getEnumeratorType, enumeratorInfoOpt.GetEnumeratorInfo.
Method
);
11722
var moveNextAsyncMethod = (MethodSymbol)AsMemberOfType(reinferredGetEnumeratorMethod.ReturnType, enumeratorInfoOpt.MoveNextInfo.
Method
);
11735
if (enumeratorInfoOpt.PatternDisposeInfo is {
Method
: var originalDisposeMethod }) // no statically known Dispose method if doing a runtime check
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
232
if (enumeratorInfo.GetEnumeratorInfo.
Method
.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (3)
177
if (!ShouldUseIEnumerableBulkAddMethod(singleSpread.Expression.Type, toListOfElementType.Parameters[0].Type, singleSpread.EnumeratorInfoOpt?.GetEnumeratorInfo.
Method
))
680
&& ShouldUseIEnumerableBulkAddMethod(spreadExpression.Type!, linqToArrayMethod.Parameters[0].Type, spreadElement.EnumeratorInfoOpt?.GetEnumeratorInfo.
Method
))
1182
if (!ShouldUseIEnumerableBulkAddMethod(rewrittenSpreadOperand.Type, addRangeMethod.Parameters[0].Type, spreadElement.EnumeratorInfoOpt?.GetEnumeratorInfo.
Method
))
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (5)
155
TypeSymbol enumeratorType = getEnumeratorInfo.
Method
.ReturnType;
163
var receiver = ConvertReceiverForInvocation(forEachSyntax, rewrittenExpression, getEnumeratorInfo.
Method
, convertedCollection.Conversion, enumeratorInfo.CollectionType);
168
if (getEnumeratorInfo.
Method
.IsExtensionMethod)
175
getEnumeratorInfo.
Method
,
324
MethodSymbol? disposeMethod = enumeratorInfo.PatternDisposeInfo?.
Method
; // pattern-based
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (2)
445
MethodSymbol? disposeMethod = disposeInfo?.
Method
;
494
MethodSymbol method = methodArgumentInfo.
Method
;
Operations\CSharpOperationFactory.cs (11)
1902
enumeratorInfoOpt.GetEnumeratorInfo.
Method
.GetPublicSymbol(),
1904
enumeratorInfoOpt.MoveNextInfo.
Method
.GetPublicSymbol(),
1911
HasImplicitConversionToOrImplementsVarianceCompatibleInterface(enumeratorInfoOpt.GetEnumeratorInfo.
Method
.ReturnType,
1916
enumeratorInfoOpt.PatternDisposeInfo?.
Method
.GetPublicSymbol(),
1943
info.
Method
,
1947
invokedAsExtensionMethod: info.
Method
.IsExtensionMethod
2039
disposeMethod: boundUsingStatement.PatternDisposeInfoOpt.
Method
.GetPublicSymbol(),
2178
disposeMethod: usingDecl.PatternDisposeInfoOpt.
Method
.GetPublicSymbol(),
2943
Debug.Assert(!patternDisposeInfo.
Method
.IsStatic);
2945
if (patternDisposeInfo.
Method
.ParameterCount == 0)
2951
patternDisposeInfo.
Method
,