63 references to ERR_OperatorNeedsMatch
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
792
or ErrorCode.
ERR_OperatorNeedsMatch
Symbols\Source\SourceMemberContainerSymbol.cs (1)
2796
diagnostics.Add(ErrorCode.
ERR_OperatorNeedsMatch
, op1.GetFirstLocation(), op1,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Semantics\ExtensionOperatorsTests.cs (9)
382
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("Extensions3.extension(S1).operator true(S1)", "false").WithLocation(400, 37),
385
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "false").WithArguments("Extensions3.extension(S2).operator false(S2)", "true").WithLocation(405, 37),
391
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("Extensions4.extension(S1).operator true(S1)", "false").WithLocation(500, 35),
10787
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "!=").WithArguments("Extensions3.extension(S1).operator !=(S1, S2)", "==").WithLocation(400, 37),
10790
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "==").WithArguments("Extensions3.extension(S2).operator ==(S2, S1)", "!=").WithLocation(405, 37),
10955
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">=").WithArguments("Extensions3.extension(S1).operator >=(S1, S2)", "<=").WithLocation(400, 37),
10958
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "<=").WithArguments("Extensions3.extension(S2).operator <=(S2, S1)", ">=").WithLocation(405, 37),
11123
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, ">").WithArguments("Extensions3.extension(S1).operator >(S1, S2)", "<").WithLocation(400, 37),
11126
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)
49234
Diagnostic(ErrorCode.
ERR_OperatorNeedsMatch
, "true").WithArguments("I2.operator true(I2)", "false").WithLocation(10, 33),
49237
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(
12182
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
12477
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
17592
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(
17735
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(
17878
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(
17991
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(
18127
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(
18270
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(
18382
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18529
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18676
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18829
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
19049
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
19241
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
19349
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected2);
19398
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected3);
19450
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19503
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.WRN_EqualityOpWithoutEquals or
19606
compilation2.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19616
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19658
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(
19668
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(
19720
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
19775
compilation3.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22588
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
)).Verify(
22738
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22804
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22849
compilation1.GetDiagnostics().Where(d => d.Code is not ((int)ErrorCode.
ERR_OperatorNeedsMatch
or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
32969
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)", "!=")