2 writes to Method
Microsoft.CodeAnalysis.CSharp (2)
Binder\Semantics\Operators\BinaryOperatorSignature.cs (2)
38this.Method = null; 49this.Method = method;
87 references to Method
Microsoft.CodeAnalysis.CSharp (85)
Binder\Binder.ValueChecks.cs (4)
3718(compoundAssignmentOperator.Operator.Method is not { } compoundMethod || 4095(compoundAssignmentOperator.Operator.Method is not { } compoundMethod || 4538if (compound.Operator.Method is { } compoundMethod) 5360if (compound.Operator.Method is { } compoundMethod)
Binder\Binder_Operators.cs (25)
192if (best.Signature.Method is { } bestMethod) 244CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, bestSignature.Method, 254bestSignature.Method, 1026CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, signature.Method, 1090signature.Method, 1147if (signature.Method is { } bestMethod) 1161bool isNullableEquality = (object)signature.Method == null && 1451if (signature.Method is { } bestMethod) 1480_ = CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, signature.Method, isUnsignedRightShift: false, signature.ConstrainedToTypeOpt, diagnostics) && 1504signature.Method, 1519Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1527signature.Method, 1623Debug.Assert(signature.Method is not null); 1625if (signature.Method.GetIsNewExtensionMember()) 1683NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1693(t.IsInterface && (signature.Method.IsAbstract || signature.Method.IsVirtual) && 1694SourceUserDefinedOperatorSymbol.IsSelfConstrainedTypeParameter((definition = signature.Method.OriginalDefinition).ReturnType.StrippedType(), definition.ContainingType)); 1701Error(diagnostics, ErrorCode.ERR_BadBoolOp, syntax, signature.Method); 1726Error(diagnostics, ErrorCode.ERR_MustHaveOpTF, syntax, signature.Method, t); 1825Error(diagnostics, ErrorCode.ERR_BadBoolOp, syntax, signature.Method); 1839NamespaceSymbol.AddExtensionContainersInType(signature.Method.OriginalDefinition.ContainingType.ContainingType, extensions); 1855Error(diagnostics, ErrorCode.ERR_MustHaveOpTF, syntax, signature.Method, signature.Method.OriginalDefinition.ContainingType.ContainingType); 2083MethodSymbol method = analysisResult.Signature.Method;
Binder\RefSafetyAnalysis.cs (1)
552if (!node.HasErrors && node.Operator.Method is { } compoundMethod)
Binder\Semantics\Operators\BinaryOperatorAnalysisResult.cs (1)
40MethodSymbol IMemberResolutionResultWithPriority<MethodSymbol>.MemberWithPriority => Signature.Method;
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (21)
847equalsIgnoringNullableAndDynamic(op.Signature.Method.ContainingType, existingSignature.Method.ContainingType)) 973if (SourceMemberContainerTypeSymbol.DoOperatorsPair(signature1.Method, operators2[i].Method)) 1016MethodSymbol op = operators[i].Method; 1268if (op1.Method?.GetMemberArityIncludingExtension() is null or 0) 1270if (op2.Method?.GetMemberArityIncludingExtension() > 0) 1275else if (op2.Method?.GetMemberArityIncludingExtension() is null or 0) 1367if ((object)op1.Method != null) 1369var p = op1.Method.OriginalDefinition.GetParameters(); 1384if ((object)op2.Method != null) 1386var p = op2.Method.OriginalDefinition.GetParameters(); 1473existing.AddRange(operators.Select(static (op) => op.Method)); 1480if (!existing.Contains(op.Method)) 1515MethodSymbol method = candidate.Method; 1586Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1603var method = candidate.Method.OriginalDefinition; 1613Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1617if (!candidate.Method.ContainingType.ExtensionParameter.Type.IsValidNullableTypeArgument() || 1618!Conversions.ConvertExtensionMethodThisArg(MakeNullable(candidate.Method.ContainingType.ExtensionParameter.Type), operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists) 1623else if (!Conversions.ConvertExtensionMethodThisArg(candidate.Method.ContainingType.ExtensionParameter.Type, operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists)
Binder\Semantics\Operators\BinaryOperatorSignature.cs (15)
66Symbol.Equals(this.Method, other.Method, TypeCompareKind.ConsiderEverything); 89Hash.Combine(Method, (int)Kind)))); 96if ((object)Method != null && Method.IsStatic) 98Debug.Assert(Method.ParameterCount == 2); 100if (!Method.ParameterRefKinds.IsDefaultOrEmpty) 102Debug.Assert(Method.ParameterRefKinds.Length == 2); 104return Method.ParameterRefKinds[0]; 116if ((object)Method != null) 118int rightIndex = Method.IsStatic ? 1 : 0; 120Debug.Assert(Method.ParameterCount == rightIndex + 1); 122if (!Method.ParameterRefKinds.IsDefaultOrEmpty) 124Debug.Assert(Method.ParameterRefKinds.Length == rightIndex + 1); 126return Method.ParameterRefKinds[rightIndex];
BoundTree\BoundExpression.cs (1)
454get { return this.Operator.Method; }
BoundTree\NullabilityRewriter.cs (2)
150if (op.Method is not null) 152op = new BinaryOperatorSignature(op.Kind, op.LeftType, op.RightType, op.ReturnType, GetUpdatedSymbol(node, op.Method), op.ConstrainedToTypeOpt);
Compilation\CSharpSemanticModel.cs (2)
3935GetSymbolsAndResultKind(compoundAssignment, compoundAssignment.Operator.Method, compoundAssignment.OriginalUserDefinedOperatorsOpt, out symbols, out resultKind); 3940Debug.Assert((object)compoundAssignment.Operator.Method == null && compoundAssignment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
FlowAnalysis\NullableWalker.cs (4)
11130if (node.Operator.Method is { } method ? 11134if (node.Operator.Method is { } instanceMethod) 11174SetUpdatedSymbol(node, node.Operator.Method, instanceMethod); 11219node.Operator.Method,
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
278!(node.Operator.Method is { IsStatic: false } method && method.GetIsNewExtensionMember()))
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (7)
26if (node.Operator.Method?.IsStatic == false) 38Debug.Assert(node.Operator.Method is { }); 39Debug.Assert(node.LeftConversion is null || (node.Left.Type!.IsReferenceType && node.Operator.Method.GetIsNewExtensionMember())); 49node.Operator.Method, 70node.Operator.Method, 79return MakeInstanceCompoundAssignmentOperatorResult(node.Syntax, node.Left, node.Right, node.Operator.Method, node.Operator.Kind.IsChecked()); 213operand = MakeBinaryOperator(syntax, node.Operator.Kind, opLHS, loweredRight, node.Operator.ReturnType, node.Operator.Method, node.Operator.ConstrainedToTypeOpt, isCompoundAssignment: true);
Operations\CSharpOperationFactory.cs (1)
1363var method = boundCompoundAssignmentOperator.Operator.Method;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\OperatorTests.cs (2)
8829Assert.Null(op.Method); 8831Assert.Equal(op, new BinaryOperatorSignature(op.Kind, op.LeftType, op.RightType, op.ReturnType, op.Method, constrainedToTypeOpt: null));