66 references to ERR_OperatorsMustBeStaticAndPublic
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
965
or ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
106
diagnostics.Add(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, this.GetFirstLocation(), this);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (25)
Semantics\ExtensionOperatorsTests.cs (16)
152
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S1).operator " + op + "(S1)").WithLocation(31, 28),
155
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S2).operator " + op + "(S2)").WithLocation(36, 28),
248
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions3.extension(S1).operator " + op + "(S1)").WithLocation(23, 28),
251
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions3.extension(S2).operator " + op + "(S2)").WithLocation(28, 28),
400
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "true").WithArguments("Extensions6.extension(S1).operator true(S1)").WithLocation(700, 30),
403
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "false").WithArguments("Extensions6.extension(S1).operator false(S1)").WithLocation(701, 30),
10549
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S1).operator " + op + "(S1, S1)").WithLocation(32, 28),
10552
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S2).operator " + op + "(S2, S2)").WithLocation(37, 28),
10643
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S1).operator " + op + "(S1, S1)").WithLocation(30, 28),
10646
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("Extensions4.extension(S2).operator " + op + "(S2, S2)").WithLocation(34, 28),
10805
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "!=").WithArguments("Extensions6.extension(S1).operator !=(S1, S1)").WithLocation(700, 28),
10808
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "==").WithArguments("Extensions6.extension(S1).operator ==(S1, S1)").WithLocation(701, 28),
10973
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, ">=").WithArguments("Extensions6.extension(S1).operator >=(S1, S1)").WithLocation(700, 28),
10976
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "<=").WithArguments("Extensions6.extension(S1).operator <=(S1, S1)").WithLocation(701, 28),
11141
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, ">").WithArguments("Extensions6.extension(S1).operator >(S1, S1)").WithLocation(700, 28),
11144
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "<").WithArguments("Extensions6.extension(S1).operator <(S1, S1)").WithLocation(701, 28),
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (9)
208
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator " + op + "(C1)").WithLocation(3, 25),
217
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator " + op + "(C1, C1)").WithLocation(4, 25),
223
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator " + op + "(C1, C1, C1)").WithLocation(5, 25)
282
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator checked " + op + "(C1)").WithLocation(3, 34),
294
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator checked " + op + "(C1, C1)").WithLocation(4, 34),
303
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C1.operator checked " + op + "(C1, C1, C1)").WithLocation(5, 34),
5302
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "++").WithArguments("C1.operator ++(int)").WithLocation(4, 26),
5351
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "++").WithArguments("C1.operator ++(params int[])").WithLocation(4, 26),
5360
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "--").WithArguments("C1.operator --()").WithLocation(5, 26),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (39)
Symbols\CheckedUserDefinedOperatorsTests.cs (4)
252
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C.operator checked " + op + "(C)").WithLocation(4, 23)
273
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C.operator checked " + op + "(C)").WithLocation(4, 23)
1448
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C.operator checked " + op + "(C, C)").WithLocation(4, 23)
2686
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("C.explicit operator checked int(C)").WithLocation(4, 31)
Symbols\StaticAbstractMembersInInterfacesTests.cs (29)
1608
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "+").WithArguments("I1.operator +(I1)").WithLocation(7, 40)
17601
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17607
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17744
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17750
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17881
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17884
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
17994
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2)").WithLocation(14, 24 + checkedKeyword.Length),
17997
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3)").WithLocation(20, 24 + checkedKeyword.Length),
18136
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18142
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18273
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C2.operator " + checkedKeyword + op + "(C2, int)").WithLocation(14, 24 + checkedKeyword.Length),
18276
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("C3.operator " + checkedKeyword + op + "(C3, int)").WithLocation(20, 24 + checkedKeyword.Length),
18385
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18403
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18532
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18550
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18679
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18697
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
18832
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1)").WithLocation(12, 17 + checkedKeyword.Length),
18850
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T)").WithLocation(42, 16 + checkedKeyword.Length),
19035
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
19044
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
19227
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I3.operator " + checkedKeyword + op + "(I1, int)").WithLocation(12, 17 + checkedKeyword.Length),
19236
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, op).WithArguments("I8<T>.operator " + checkedKeyword + op + "(T, int)").WithLocation(42, 16 + checkedKeyword.Length)
28442
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28448
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
28579
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("C2." + op + " operator " + checkedKeyword + "int(C2)").WithLocation(14, 30 + checkedKeyword.Length),
28582
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("C3." + op + " operator " + checkedKeyword + "int(C3)").WithLocation(20, 30 + checkedKeyword.Length),
Symbols\SymbolErrorTests.cs (2)
10718
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "int").WithArguments("x.ii.iii.implicit operator int(x.ii.iii)")
10868
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "+").WithArguments("IA.operator +(int, int)").WithLocation(4, 17),
Symbols\UserDefinedOperatorErrorTests.cs (4)
209
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "-").WithArguments("C.operator -(C, C)").WithLocation(5, 34),
215
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "<<").WithArguments("C.operator <<(C, int)").WithLocation(6, 32),
230
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "-").WithArguments("C.operator -(C)").WithLocation(10, 33),
236
Diagnostic(ErrorCode.
ERR_OperatorsMustBeStaticAndPublic
, "~").WithArguments("C.operator ~(C)").WithLocation(11, 34),