115 references to Equals
Microsoft.CodeAnalysis.CSharp (46)
Binder\Binder_Constraints.cs (1)
497
if (!performOnlyCycleSafeValidation && constraintTypes.Contains(c => type.
Equals
(c, TypeCompareKind.AllIgnoreOptions)))
Binder\ForEachEnumeratorInfo.cs (1)
81
(collectionType.HasInlineArrayAttribute(out _) && collectionType.TryGetInlineArrayElementField() is FieldSymbol elementField && elementType.
Equals
(elementField.TypeWithAnnotations, TypeCompareKind.ConsiderEverything)));
Binder\ForEachLoopBinder.cs (1)
883
((result is EnumeratorResult.Succeeded && builder.ElementTypeWithAnnotations.
Equals
(elementField.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions) &&
Binder\Semantics\BestTypeInferrer.cs (1)
26
Debug.Assert(!type.HasType || type.
Equals
(example, TypeCompareKind.AllIgnoreOptions));
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (6)
2959
if (!candidate.
Equals
(candidate2, TypeCompareKind.ConsiderEverything) &&
2972
Debug.Assert(!best.
Equals
(candidate, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
3393
type.SetUnknownNullabilityForReferenceTypes().
Equals
(type, TypeCompareKind.ConsiderEverything));
3436
if (bound.
Equals
(candidate, comparison))
3467
else if (bound.
Equals
(candidate, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes))
3528
return x.
Equals
(y, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes);
BoundTree\BoundInlineArrayAccess.cs (1)
62
Debug.Assert(((NamedTypeSymbol)Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].
Equals
(Expression.Type?.TryGetInlineArrayElementField()?.TypeWithAnnotations ?? default, TypeCompareKind.ConsiderEverything));
BoundTree\UnboundLambda.cs (2)
833
lambdaSymbol.ReturnTypeWithAnnotations.
Equals
(returnType, TypeCompareKind.ConsiderEverything))
1088
if (!other.ParameterTypes[i].
Equals
(this.ParameterTypes[i], TypeCompareKind.ConsiderEverything) ||
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
540
return otherType.
Equals
(expectedType, TypeCompareKind.CLRSignatureCompareOptions);
FlowAnalysis\NullableWalker.cs (4)
9597
if (explicitType?.
Equals
(targetTypeWithNullability, TypeCompareKind.ConsiderEverything) == true)
10036
isLiftedConversion = parameterType.
Equals
(underlyingOperandTypeWithAnnotations, TypeCompareKind.AllIgnoreOptions);
12812
return type1.
Equals
(type2, TypeCompareKind.AllIgnoreOptions) &&
12813
!type1.
Equals
(type2, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.IgnoreNullableModifiersForReferenceTypes);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
265
Debug.Assert(elementType.
Equals
(spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], TypeCompareKind.AllIgnoreOptions));
Symbols\AnonymousTypes\AnonymousTypeField.cs (1)
63
return x.TypeWithAnnotations.
Equals
(y.TypeWithAnnotations, comparison)
Symbols\ArrayTypeSymbol.cs (1)
355
!other.ElementTypeWithAnnotations.
Equals
(ElementTypeWithAnnotations, comparison))
Symbols\ConversionSignatureComparer.cs (1)
52
&& member1.ParameterTypesWithAnnotations[0].
Equals
(member2.ParameterTypesWithAnnotations[0], TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)
Symbols\DiscardSymbol.cs (1)
38
public override bool Equals(Symbol? obj, TypeCompareKind compareKind) => obj is DiscardSymbol other && this.TypeWithAnnotations.
Equals
(other.TypeWithAnnotations, compareKind);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
725
|| !ReturnTypeWithAnnotations.
Equals
(other.ReturnTypeWithAnnotations, compareKind))
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
63
&& TypeWithAnnotations.
Equals
(other.TypeWithAnnotations, compareKind);
Symbols\MemberSignatureComparer.cs (2)
588
if (!returnType1.
Equals
(returnType2, typeComparison))
767
if (!type1.
Equals
(type2, typeComparison))
Symbols\NamedTypeSymbol.cs (1)
1029
if (!typeArgument.
Equals
(otherTypeArgument, comparison))
Symbols\PointerTypeSymbol.cs (1)
241
if ((object?)other == null || !other._pointedAtType.
Equals
(_pointedAtType, comparison))
Symbols\Source\LambdaSymbol.cs (1)
387
(p1, p2, compareKind) => p1.
Equals
(p2, compareKind))
Symbols\Source\SourceEventSymbol.cs (1)
871
if (!TypeWithAnnotations.
Equals
(implementation.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions))
Symbols\Source\SourceMemberContainerSymbol.cs (3)
2847
if (!op1.ParameterTypesWithAnnotations[p].
Equals
(op2.ParameterTypesWithAnnotations[p], TypeCompareKind.AllIgnoreOptions))
5139
&& field.TypeWithAnnotations.
Equals
(param.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions))
5148
&& prop.TypeWithAnnotations.
Equals
(param.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions))
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
962
if (!overridingMemberType.
Equals
(overriddenMemberType, TypeCompareKind.AllIgnoreOptions))
1065
!overridingMemberType.
Equals
(overriddenMemberType, TypeCompareKind.AllIgnoreOptions))
1217
return overridingReturnType.
Equals
(overriddenReturnType, TypeCompareKind.AllIgnoreOptions);
Symbols\Source\SourceNamedTypeSymbol.cs (3)
540
Debug.Assert(originalConstraintTypes[j].
Equals
(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny));
599
if (!constraintType1.
Equals
(constraintType2, TypeCompareKind.ObliviousNullableModifierMatchesAny))
606
if (!constraintType1.
Equals
(constraintType2, TypeCompareKind.ConsiderEverything))
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
489
bool hasTypeDifferences = !constructedDefinition.ReturnTypeWithAnnotations.
Equals
(implementation.ReturnTypeWithAnnotations, TypeCompareKind.AllIgnoreOptions);
Symbols\Source\SourcePropertySymbol.cs (1)
734
bool hasTypeDifferences = !TypeWithAnnotations.
Equals
(implementation.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions);
Symbols\SubstitutedMethodSymbol.cs (1)
464
if (!this.TypeArgumentsWithAnnotations[i].
Equals
(other.TypeArgumentsWithAnnotations[i], compareKind))
Symbols\TypeWithAnnotations.cs (2)
417
return x.
Equals
(y, _compareKind);
763
return other is TypeWithAnnotations t && this.
Equals
(t, TypeCompareKind.ConsiderEverything);
Symbols\UpdatedContainingSymbolLocal.cs (1)
69
(TypeWithAnnotations.
Equals
(otherLocal.TypeWithAnnotations, compareKind) &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Attributes\AttributeTests_Nullable.cs (1)
4215
Assert.True(updated.
Equals
(type, TypeCompareKind.ConsiderEverything));
Semantics\RecordTests.cs (2)
12552
Assert.True(method.OverriddenMethod.ReturnTypeWithAnnotations.
Equals
(returnType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
12559
Assert.True(method.OverriddenMethod.Parameters[0].TypeWithAnnotations.
Equals
(parameterType, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (58)
Semantics\NativeIntegerTests.cs (2)
598
Assert.True(fromMember.
Equals
(fromUnderlyingMember, TypeCompareKind.IgnoreNativeIntegers));
605
Assert.NotEqual(containsType(fromMember, useNativeInteger: true), fromMember.
Equals
(fromUnderlyingMember, TypeCompareKind.ConsiderEverything));
Semantics\NullableReferenceTypesTests.cs (55)
12331
Assert.False(member.TypeWithAnnotations.
Equals
(member.OverriddenEvent.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12335
Assert.True(e3.TypeWithAnnotations.
Equals
(e3.OverriddenEvent.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12344
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12345
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12425
Assert.Equal(expectMatch, member.ReturnTypeWithAnnotations.
Equals
(member.OverriddenMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12426
Assert.Equal(expectMatch, member.Parameters.Single().TypeWithAnnotations.
Equals
(member.OverriddenMethod.Parameters.Single().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12692
Assert.False(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12703
Assert.True(impl.TypeWithAnnotations.
Equals
(e3.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12712
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12713
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12785
Assert.False(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12791
Assert.True(impl.TypeWithAnnotations.
Equals
(e3.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12800
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.AddMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12801
Assert.True(ev.TypeWithAnnotations.
Equals
(ev.RemoveMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12882
Assert.False(member.TypeWithAnnotations.
Equals
(member.OverriddenProperty.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12887
Assert.True(member.TypeWithAnnotations.
Equals
(member.OverriddenProperty.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
12896
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
12897
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
13033
Assert.False(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
13039
Assert.True(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
13048
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
13049
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
13124
Assert.False(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
13130
Assert.True(impl.TypeWithAnnotations.
Equals
(member.TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
13139
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
13140
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
13205
Assert.False(member.ReturnTypeWithAnnotations.
Equals
(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations,
13324
Assert.False(implementing.ReturnTypeWithAnnotations.
Equals
(implemented.ReturnTypeWithAnnotations,
13332
Assert.True(implementing.ReturnTypeWithAnnotations.
Equals
(implemented.ReturnTypeWithAnnotations,
13411
Assert.False(implementing.ReturnTypeWithAnnotations.
Equals
(implemented.ReturnTypeWithAnnotations,
13685
Assert.False(m1.Parameters[0].TypeWithAnnotations.
Equals
(m1.OverriddenMethod.ConstructIfGeneric(m1.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations,
14025
Assert.False(member.ReturnTypeWithAnnotations.
Equals
(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations,
14030
Assert.True(m3.ReturnTypeWithAnnotations.
Equals
(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).ReturnTypeWithAnnotations,
14132
Assert.False(member.Parameters[0].TypeWithAnnotations.
Equals
(member.OverriddenMethod.ConstructIfGeneric(member.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations,
14137
Assert.True(m3.Parameters[0].TypeWithAnnotations.
Equals
(m3.OverriddenMethod.ConstructIfGeneric(m3.TypeParameters.SelectAsArray(t => TypeWithAnnotations.Create(t))).Parameters[0].TypeWithAnnotations,
16501
Assert.False(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations,
16509
Assert.True(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations,
16632
Assert.False(member.Parameters[0].TypeWithAnnotations.
Equals
(member.OverriddenProperty.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16638
Assert.True(member.Parameters[0].TypeWithAnnotations.
Equals
(member.OverriddenProperty.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16647
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
16648
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
16717
Assert.False(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16723
Assert.True(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16732
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
16733
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
16802
Assert.False(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16808
Assert.True(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations, TypeCompareKind.AllIgnoreOptions & ~TypeCompareKind.AllNullableIgnoreOptions));
16817
Assert.True(property.TypeWithAnnotations.
Equals
(property.GetMethod.ReturnTypeWithAnnotations, TypeCompareKind.ConsiderEverything));
16818
Assert.True(property.TypeWithAnnotations.
Equals
(property.SetMethod.Parameters.Last().TypeWithAnnotations, TypeCompareKind.ConsiderEverything));
17731
Assert.False(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations,
17739
Assert.True(implementing.Parameters[0].TypeWithAnnotations.
Equals
(implemented.Parameters[0].TypeWithAnnotations,
17799
Assert.False(implementing.ReturnTypeWithAnnotations.
Equals
(implemented.ReturnTypeWithAnnotations,
17807
Assert.True(implementing.ReturnTypeWithAnnotations.
Equals
(implemented.ReturnTypeWithAnnotations,
17878
Assert.False(m1Impl.Parameters[i].TypeWithAnnotations.
Equals
(m1Def.Parameters[i].TypeWithAnnotations,
17882
Assert.True(m1Impl.Parameters[3].TypeWithAnnotations.
Equals
(m1Def.Parameters[3].TypeWithAnnotations,
Semantics\OperatorTests.cs (1)
6934
OfType<MethodSymbol>().Single(m => m.ParameterTypesWithAnnotations[0].
Equals
(m.ParameterTypesWithAnnotations[1], TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Symbols\CustomModifiersTests.cs (4)
2485
Assert.False(t1.
Equals
(t2, TypeCompareKind.ConsiderEverything));
2486
Assert.False(t2.
Equals
(t1, TypeCompareKind.ConsiderEverything));
2490
Assert.True(t1.
Equals
(t2, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds));
2491
Assert.True(t2.
Equals
(t1, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds));
Symbols\FunctionPointerTypeSymbolTests.cs (4)
915
Assert.False(ret1.
Equals
(ret2, TypeCompareKind.ConsiderEverything));
916
Assert.False(ret1.
Equals
(ret2, TypeCompareKind.AllNullableIgnoreOptions));
922
Assert.True(ret1.
Equals
(ret2, TypeCompareKind.AllNullableIgnoreOptions));
924
Assert.Equal(returnEquality == Equality.Equal, ret1.
Equals
(ret2, TypeCompareKind.ConsiderEverything));