20 overrides of IsExtensionMethod
Microsoft.CodeAnalysis.CSharp (20)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
80public override bool IsExtensionMethod
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
89public sealed override bool IsExtensionMethod
Symbols\ErrorMethodSymbol.cs (1)
189public override bool IsExtensionMethod
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
821public override bool IsExtensionMethod => false;
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
965public override bool IsExtensionMethod
Symbols\ReducedExtensionMethodSymbol.cs (1)
416public override bool IsExtensionMethod
Symbols\SignatureOnlyMethodSymbol.cs (1)
133public override bool IsExtensionMethod { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\Source\LambdaSymbol.cs (1)
264public override bool IsExtensionMethod
Symbols\Source\LocalFunctionSymbol.cs (1)
320public override bool IsExtensionMethod
Symbols\Source\SourceMemberMethodSymbol.cs (1)
562public sealed override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
103public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (1)
196public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (1)
307public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
201public sealed override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
248public sealed override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
84public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
121public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (1)
149public override bool IsExtensionMethod
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
261public override bool IsExtensionMethod
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
69public override bool IsExtensionMethod
61 references to IsExtensionMethod
Microsoft.CodeAnalysis.CSharp (61)
Binder\Binder_Await.cs (1)
457if (getResultMethod.IsExtensionMethod || getResultMethod.GetIsNewExtensionMember())
Binder\Binder_Conversions.cs (1)
2985if (method.IsExtensionMethod)
Binder\Binder_Deconstruct.cs (1)
686for (int i = (deconstructMethod.IsExtensionMethod ? 1 : 0); i < parameters.Length; i++) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
Binder\Binder_Expressions.cs (2)
8722if (method.IsExtensionMethod 11074bool memberCountsAsStatic = extensionMember is MethodSymbol { IsExtensionMethod: true } ? false : extensionMember.IsStatic;
Binder\Binder_Patterns.cs (1)
1061int skippedExtensionParameters = deconstructMethod?.IsExtensionMethod == true ? 1 : 0; // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
Binder\Binder_Statements.cs (1)
769if (disposeMethod is not null && (disposeMethod.IsExtensionMethod || disposeMethod.GetIsNewExtensionMember()))
Binder\ForEachLoopBinder.cs (12)
241if (getEnumeratorMethod.IsExtensionMethod) 581builder.GetEnumeratorInfo.Method.IsExtensionMethod || 873Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod || builder.GetEnumeratorInfo.Method.GetIsNewExtensionMember()); 920Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod || builder.GetEnumeratorInfo.Method.GetIsNewExtensionMember()); 1031Debug.Assert(!(viaExtensionMethod && builder.GetEnumeratorInfo.Method.IsExtensionMethod && builder.GetEnumeratorInfo.Method.Parameters.IsDefaultOrEmpty)); 1032Debug.Assert(!(viaExtensionMethod && !builder.GetEnumeratorInfo.Method.IsExtensionMethod && !builder.GetEnumeratorInfo.Method.GetIsNewExtensionMember())); 1038if (builder.GetEnumeratorInfo.Method.IsExtensionMethod) 1226Debug.Assert(!patternDisposeMethod.IsExtensionMethod && !patternDisposeMethod.GetIsNewExtensionMember()); 1548Debug.Assert(result.IsExtensionMethod || result.GetIsNewExtensionMember()); 1562if (result.IsExtensionMethod) 1955Debug.Assert((extensionReceiverOpt != null) == method.IsExtensionMethod); 1964if (method.IsExtensionMethod)
Binder\RefSafetyAnalysis.cs (1)
607if (method.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
Binder\Semantics\Conversions\Conversions.cs (2)
333Debug.Assert(method.IsExtensionMethod || method.GetIsNewExtensionMember()); 337if (method.IsExtensionMethod)
Binder\Semantics\OverloadResolution\MethodGroup.cs (1)
54Debug.Assert(method.IsExtensionMethod || method.GetIsNewExtensionMember());
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
613if (member is MethodSymbol { IsExtensionMethod: true })
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
198if (!symbol.IsStatic || ((MethodSymbol)symbol).IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
Compilation\CSharpSemanticModel.cs (3)
1668if (symbol is MethodSymbol { IsExtensionMethod: true } extensionMethod) 4790if (call.InvokedAsExtensionMethod && method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension) 4807if (delegateCreation.IsExtensionMethod && method.IsExtensionMethod && (receiverOpt != null))
FlowAnalysis\AbstractFlowPass.cs (1)
1645return method.IsStatic && !method.IsExtensionMethod; // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
FlowAnalysis\NullableWalker.cs (2)
11078if (enumeratorInfoOpt?.GetEnumeratorInfo is { Method: { IsExtensionMethod: true, Parameters: var parameters } } enumeratorMethodInfo) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions 11145bool reportedDiagnostic = enumeratorInfoOpt?.GetEnumeratorInfo.Method is { IsExtensionMethod: true } // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
234if (enumeratorInfo.GetEnumeratorInfo.Method.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
Lowering\ExtensionMethodReferenceRewriter.cs (8)
174{ Name: nameof(VisitTypeOfOperator) } => method is { Name: "GetTypeFromHandle", IsExtensionMethod: false }, // GetTypeFromHandle cannot be an extension method 175{ Name: nameof(VisitRefTypeOperator) } => method is { Name: "GetTypeFromHandle", IsExtensionMethod: false }, // GetTypeFromHandle cannot be an extension method 176{ Name: nameof(VisitReadOnlySpanFromArray) } => method is { Name: "op_Implicit", IsExtensionMethod: false }, // Conversion operator from array to span cannot be an extension method 179{ Name: nameof(VisitUnaryOperator) } => !method.IsExtensionMethod, // Expression tree context. At the moment an operator cannot be an extension method 180{ Name: nameof(VisitUserDefinedConditionalLogicalOperator) } => !method.IsExtensionMethod, // Expression tree context. At the moment an operator cannot be an extension method 181{ Name: nameof(VisitCollectionElementInitializer) } => !method.IsExtensionMethod, // Expression tree context. At the moment an extension method cannot be used in expression tree here. 182{ Name: nameof(VisitAwaitableInfo) } => method is { Name: "GetResult", IsExtensionMethod: false }, // Cannot be an extension method 235(!node.Method.IsExtensionMethod && !node.Method.GetIsNewExtensionMember())); // Expression tree context. At the moment an operator cannot be an extension method
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
174Debug.Assert(method.IsExtensionMethod);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (2)
167if (getEnumeratorInfo.Method.IsExtensionMethod) 184allowExtensionAndOptionalParameters: isAsync || getEnumeratorInfo.Method.IsExtensionMethod || getEnumeratorInfo.Method.GetIsNewExtensionMember(), firstRewrittenArgument: firstRewrittenArgument);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (3)
103Debug.Assert(!elementInitializer.AddMethod.IsExtensionMethod); 185.Skip(addMethod.IsExtensionMethod ? 1 : 0) 232Debug.Assert(addMethod.IsExtensionMethod);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (2)
497if (method.IsExtensionMethod) 532invokedAsExtensionMethod: method.IsExtensionMethod);
Operations\CSharpOperationFactory.cs (1)
1947invokedAsExtensionMethod: info.Method.IsExtensionMethod
Symbols\MemberSymbolExtensions.cs (1)
196if (method.IsExtensionMethod)
Symbols\MethodSymbol.cs (2)
757if (!this.IsExtensionMethod || this.MethodKind == MethodKind.ReducedExtension || receiverType.IsVoidType()) 772return (this.IsExtensionMethod && this.MethodKind != MethodKind.ReducedExtension) ? ReducedExtensionMethodSymbol.Create(this) : null;
Symbols\NamedTypeSymbol.cs (1)
353if (method.IsExtensionMethod &&
Symbols\PublicModel\MethodSymbol.cs (1)
313bool IMethodSymbol.IsExtensionMethod => _underlying.IsExtensionMethod;
Symbols\ReducedExtensionMethodSymbol.cs (4)
39Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 74Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 94Debug.Assert(reducedFrom.IsExtensionMethod); 115Debug.Assert(method.IsExtensionMethod);
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1591if (addMethods[0].IsExtensionMethod || addMethods[0].GetIsNewExtensionMember()) // No need to check other methods, extensions are never mixed with instance methods
Symbols\Source\SourceMethodSymbol.cs (1)
196if (target.IsExtensionMethod)
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
73return UnderlyingMethod.IsExtensionMethod;