2 writes to Method
Microsoft.CodeAnalysis.CSharp (2)
Binder\Semantics\Operators\BinaryOperatorSignature.cs (2)
38this.Method = null; 49this.Method = method;
89 references to Method
Microsoft.CodeAnalysis.CSharp (87)
Binder\Binder.ValueChecks.cs (5)
294var method = compoundOperator.Operator.Method; 3928(compoundAssignmentOperator.Operator.Method is not { } compoundMethod || 4273(compoundAssignmentOperator.Operator.Method is not { } compoundMethod || 4654if (compound.Operator.Method is { } compoundMethod) 5414if (compound.Operator.Method is { } compoundMethod)
Binder\Binder_Operators.cs (26)
192if (best.Signature.Method is { } bestMethod) 244CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, bestSignature.Method, 254bestSignature.Method, 1033CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, signature.Method, 1097signature.Method, 1154if (signature.Method is { } bestMethod) 1168bool isNullableEquality = (object)signature.Method == null && 1458if (signature.Method is { } bestMethod) 1487_ = CheckConstraintLanguageVersionAndRuntimeSupportForOperator(node, signature.Method, isUnsignedRightShift: false, signature.ConstrainedToTypeOpt, diagnostics) && 1511signature.Method, 1526Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1534signature.Method, 1630Debug.Assert(signature.Method is not null); 1632if (signature.Method.GetIsNewExtensionMember()) 1690NamedTypeSymbol t = (NamedTypeSymbol)signature.Method.ContainingType; 1700(t.IsInterface && (signature.Method.IsAbstract || signature.Method.IsVirtual) && 1701SourceUserDefinedOperatorSymbol.IsSelfConstrainedTypeParameter((definition = signature.Method.OriginalDefinition).ReturnType.StrippedType(), definition.ContainingType)); 1708Error(diagnostics, ErrorCode.ERR_BadBoolOp, syntax, signature.Method); 1733Error(diagnostics, ErrorCode.ERR_MustHaveOpTF, syntax, signature.Method, t); 1832Error(diagnostics, ErrorCode.ERR_BadBoolOp, syntax, signature.Method); 1847signature.Method.OriginalDefinition.ContainingType.ContainingType.GetExtensionMembers(extensionCandidates, 1859signature.Method.OriginalDefinition.ContainingType.ContainingType.GetExtensionMembers(extensionCandidates, 1873Error(diagnostics, ErrorCode.ERR_MustHaveOpTF, syntax, signature.Method, signature.Method.OriginalDefinition.ContainingType.ContainingType); 2103MethodSymbol method = analysisResult.Signature.Method;
Binder\RefSafetyAnalysis.cs (1)
593if (!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)) 1024MethodSymbol op = operators[i].Method; 1276if (op1.Method?.GetMemberArityIncludingExtension() is null or 0) 1278if (op2.Method?.GetMemberArityIncludingExtension() > 0) 1283else if (op2.Method?.GetMemberArityIncludingExtension() is null or 0) 1375if ((object)op1.Method != null) 1377var p = op1.Method.OriginalDefinition.GetParameters(); 1392if ((object)op2.Method != null) 1394var p = op2.Method.OriginalDefinition.GetParameters(); 1481existing.AddRange(operators.Select(static (op) => op.Method)); 1488if (!existing.Contains(op.Method)) 1517MethodSymbol method = candidate.Method; 1588Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1605var method = candidate.Method.OriginalDefinition; 1615Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1619if (!candidate.Method.ContainingType.ExtensionParameter.Type.IsValidNullableTypeArgument() || 1620!Conversions.ConvertExtensionMethodThisArg(MakeNullable(candidate.Method.ContainingType.ExtensionParameter.Type), operand.Type, ref useSiteInfo, isMethodGroupConversion: false).Exists) 1625else 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)
3943GetSymbolsAndResultKind(compoundAssignment, compoundAssignment.Operator.Method, compoundAssignment.OriginalUserDefinedOperatorsOpt, out symbols, out resultKind); 3948Debug.Assert((object)compoundAssignment.Operator.Method == null && compoundAssignment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
FlowAnalysis\NullableWalker.cs (4)
11266if (node.Operator.Method is { } method ? 11270if (node.Operator.Method is { } instanceMethod) 11309SetUpdatedSymbol(node, node.Operator.Method, instanceMethod); 11354node.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(), AssignmentKind.CompoundAssignment); 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));