63 references to ERR_OperatorNeedsMatch
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
794
or ErrorCode.
ERR_OperatorNeedsMatch
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2787
diagnostics.Add(ErrorCode.
ERR_OperatorNeedsMatch
, op1.GetFirstLocation(), op1,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Semantics\ExtensionOperatorsTests.cs (9)
383
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("Extensions3.extension(S1).operator true(S1)", "false").WithLocation(400, 37),
386
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "false").WithArguments("Extensions3.extension(S2).operator false(S2)", "true").WithLocation(405, 37),
392
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("Extensions4.extension(S1).operator true(S1)", "false").WithLocation(500, 35),
10917
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "!=").WithArguments("Extensions3.extension(S1).operator !=(S1, S2)", "==").WithLocation(400, 37),
10920
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "==").WithArguments("Extensions3.extension(S2).operator ==(S2, S1)", "!=").WithLocation(405, 37),
11085
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">=").WithArguments("Extensions3.extension(S1).operator >=(S1, S2)", "<=").WithLocation(400, 37),
11088
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "<=").WithArguments("Extensions3.extension(S2).operator <=(S2, S1)", ">=").WithLocation(405, 37),
11253
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">").WithArguments("Extensions3.extension(S1).operator >(S1, S2)", "<").WithLocation(400, 37),
11256
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "<").WithArguments("Extensions3.extension(S2).operator <(S2, S1)", ">").WithLocation(405, 37),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (52)
Symbols\CheckedUserDefinedOperatorsTests.cs (8)
2198
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
2241
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
2298
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2309
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2342
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2392
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2403
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2436
compilation.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
Symbols\DefaultInterfaceImplementationTests.cs (2)
49230
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("I2.operator true(I2)", "false").WithLocation(10, 33),
49233
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "false").WithArguments("I3.operator false(I3)", "true").WithLocation(15, 33),
Symbols\Source\MethodTests.cs (1)
2048
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("A.operator true(A, A)", "false")
Symbols\StaticAbstractMembersInInterfacesTests.cs (35)
7224
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7529
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7623
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7722
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
8056
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
8153
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
12104
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
12399
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
17514
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
17657
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
17800
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
17913
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
18049
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18192
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18304
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18451
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18598
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18751
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18971
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
19163
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
19271
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected2);
19320
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected3);
19372
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19425
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or
19528
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19538
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19580
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19590
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19642
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
19697
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22510
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
)).Verify(
22660
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22726
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22771
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
32891
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or
Symbols\SymbolErrorTests.cs (6)
2983
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("MyClass.operator true(MyClass)", "false"),
2986
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "<").WithArguments("MyClass.operator <(MyClass, int)", ">"),
2989
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">").WithArguments("MyClass.operator >(MyClass, double)", "<"),
2992
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "<=").WithArguments("MyClass.operator <=(MyClass, MyClass)", ">="),
2995
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">=").WithArguments("MyClass.operator >=(MyClass, MyClass)", "<="),
2998
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "==").WithArguments("MyClass.operator ==(MyClass, MyClass)", "!=")