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