161 references to ERR_BadUnaryOp
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Expressions.cs (7)
7691
diagnostics.Add(ErrorCode.
ERR_BadUnaryOp
, operatorToken.GetLocation(), SyntaxFacts.GetText(operatorToken.Kind()), leftType);
7708
diagnostics.Add(ErrorCode.
ERR_BadUnaryOp
, node.Location, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
7784
Error(diagnostics, ErrorCode.
ERR_BadUnaryOp
, node, operatorToken.Text, boundLeft.Display);
11513
DiagnosticInfo diagnosticInfo = new CSDiagnosticInfo(ErrorCode.
ERR_BadUnaryOp
, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
11523
Error(diagnostics, ErrorCode.
ERR_BadUnaryOp
, operatorToken.GetLocation(), operatorToken.Text, receiver.Display);
11530
Error(diagnostics, ErrorCode.
ERR_BadUnaryOp
, operatorToken.GetLocation(), operatorToken.Text, receiverType);
11537
Error(diagnostics, ErrorCode.
ERR_BadUnaryOp
, operatorToken.GetLocation(), operatorToken.Text, receiverType);
Binder\Binder_Operators.cs (2)
1260
ErrorCode.
ERR_BadUnaryOp
; // Operator '{0}' cannot be applied to operand of type '{1}'
4604
Error(diagnostics, ErrorCode.
ERR_BadUnaryOp
, node, SyntaxFacts.GetText(SyntaxKind.IsKeyword), operand.Display);
Errors\ErrorFacts.cs (1)
656
or ErrorCode.
ERR_BadUnaryOp
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenConditionalOperatorTests.cs (1)
3924
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "T").WithLocation(16, 23)
CodeGen\CodeGenFunctionPointersTests.cs (2)
5325
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, $"{op}ptr").WithArguments(op, "delegate*<void>").WithLocation(6, 13)
5346
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, $"ptr{op}").WithArguments(op, "delegate*<void>").WithLocation(6, 13)
CodeGen\CodeGenTupleEqualityTests.cs (1)
764
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!t1").WithArguments("!", "(int, int)").WithLocation(10, 13)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\NumericIntPtrTests.cs (4)
6059
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, $"{op}operand").WithArguments(op, AsNative(opType));
6285
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, isPrefix ? op + "operand" : "operand" + op).WithArguments(op, opType);
6659
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "operand").WithArguments(op, opType);
8899
static DiagnosticDescription[] getBadUnaryOpDiagnostics(string opType, string op, string operand) => new[] { Diagnostic(ErrorCode.
ERR_BadUnaryOp
, operand).WithArguments(op, AsNative(opType)) };
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (82)
Diagnostics\OperationAnalyzerTests.cs (4)
1612
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-x", new object[] { "-", "A" }).WithLocation(31, 13))
1668
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.Length").WithArguments(".", "<null>").WithLocation(8, 17),
1707
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-f").WithArguments("-", "string").WithLocation(11, 16),
1708
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "f++").WithArguments("++", "string").WithLocation(16, 9))
RefReadonlyParameterTests.cs (1)
5199
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "c--").WithArguments("--", "C").WithLocation(5, 1),
RefStructInterfacesTests.cs (1)
21408
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1<T>?").WithLocation(10, 18)
Semantics\ExtensionOperatorsTests.cs (31)
1181
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1").WithLocation(21, 13)
1224
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1").WithLocation(22, 13),
1227
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s2").WithArguments("+", "S1?").WithLocation(26, 13),
1417
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1<int>").WithLocation(17, 13)
1919
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1?").WithLocation(21, 13),
2036
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+(() => 1)").WithArguments("+", "lambda expression").WithLocation(22, 13)
2075
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "object").WithLocation(17, 13)
4854
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "s1").WithArguments(op, "S1").WithLocation(6, 9),
4857
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "s1").WithArguments(op, "S1").WithLocation(10, 18)
4960
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "c1").WithArguments(op, "C1").WithLocation(7, 9),
4963
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "c1").WithArguments(op, "C1").WithLocation(13, 18)
6297
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1?").WithLocation(20, 13)
6378
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1").WithLocation(21, 13)
6419
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1").WithLocation(19, 13),
6468
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1").WithLocation(22, 13),
6471
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s2").WithArguments("++", "S1?").WithLocation(26, 13),
6518
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1").WithLocation(22, 13),
6524
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s2").WithArguments("++", "S1?").WithLocation(26, 13),
6599
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1").WithLocation(17, 13),
6602
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s2").WithArguments("++", "S1?").WithLocation(21, 13)
6802
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++a1").WithArguments("++", "int[]").WithLocation(17, 13),
7109
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1<int>").WithLocation(17, 13)
7143
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1<int>").WithLocation(17, 13)
7453
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "c1").WithArguments(op, "C1").WithLocation(6, 13),
7456
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "c1").WithArguments(op, "C1").WithLocation(10, 17)
7953
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "S1?").WithLocation(21, 13),
8147
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++P").WithArguments("++", "object").WithLocation(18, 13)
8191
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++s1").WithArguments("++", "object").WithLocation(17, 13)
8424
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "s1++").WithArguments("++", "S1").WithLocation(6, 9)
8441
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "s1++").WithArguments("++", "S1").WithLocation(6, 13)
8501
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "c1++").WithArguments("++", "C1").WithLocation(6, 13)
Semantics\ExtensionTests.cs (3)
20369
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, ".").WithArguments(".", "void").WithLocation(1, 11));
23194
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.Property").WithArguments(".", "<null>").WithLocation(1, 1),
23197
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.Property").WithArguments(".", "<null>").WithLocation(2, 5));
Semantics\ExtensionTests2.cs (2)
318
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.M1").WithArguments(".", "<null>").WithLocation(1, 1),
321
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.M2").WithArguments(".", "<null>").WithLocation(2, 1));
Semantics\PatternMatchingTests.cs (4)
3616
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(1, object.Equals) is()").WithArguments("is", "(int, method group)").WithLocation(8, 17)
3656
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(1, null) is 4").WithArguments("is", "(int, <null>)").WithLocation(9, 13),
3671
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(1, null) is var x4").WithArguments("is", "(int, <null>)").WithLocation(13, 13)
3692
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(1, null) is Program").WithArguments("is", "(int, <null>)").WithLocation(6, 13)
Semantics\PrimaryConstructorTests.cs (17)
8419
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(100, 20),
8422
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(200, 34),
8425
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(300, 46),
8428
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(400, 52),
8431
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(500, 9),
8434
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(600, 50),
8437
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(700, 34),
8440
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(800, 16),
8443
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(900, 9)
8530
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(100, 9),
8533
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(200, 13),
8536
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(300, 27),
8539
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(400, 31),
8542
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(500, 9),
8545
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(600, 31),
8548
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(700, 13),
8551
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "p1++").WithArguments("++", "string").WithLocation(800, 9)
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (19)
3270
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "C1").WithLocation(23, 9),
3273
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "C1").WithLocation(30, 13),
3276
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "T").WithLocation(36, 9),
3279
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "T").WithLocation(43, 13),
3282
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "T").WithLocation(49, 9),
3285
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op +"GetA(x)[Get0()]").WithArguments(op, "T").WithLocation(56, 13)
4339
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "C1").WithLocation(23, 9),
4342
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "C1").WithLocation(30, 13),
4345
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "T").WithLocation(36, 9),
4348
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "T").WithLocation(43, 13),
4351
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "T").WithLocation(49, 9),
4354
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "GetA(x)[Get0()]" + op).WithArguments(op, "T").WithLocation(56, 13)
4606
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "x" + op).WithArguments(op, "C1").WithLocation(7, 16)
4785
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "GetA(x)[Get0()]").WithArguments(op, "C1").WithLocation(13, 9)
5318
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++x").WithArguments("++", "C1").WithLocation(7, 9),
5321
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "--x").WithArguments("--", "C1").WithLocation(8, 9)
5370
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++x").WithArguments("++", "C1").WithLocation(7, 9),
5373
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "--x").WithArguments("--", "C1").WithLocation(8, 9)
5465
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++x").WithArguments("++", "C1").WithLocation(7, 9),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (3)
IOperation\IOperationTests_IConditionalAccessExpression.cs (2)
1523
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "int").WithLocation(6, 16)
1613
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "int").WithLocation(6, 16)
IOperation\IOperationTests_InvalidExpression.cs (1)
280
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "++x").WithArguments("++", "Program").WithLocation(9, 33)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (52)
Semantics\BindingTests.cs (2)
258
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!a.E").WithArguments("!", "method group").WithLocation(16, 17),
498
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.M").WithArguments(".", "<null>"),
Semantics\ConstantTests.cs (2)
1719
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-9223372036854775808UL").WithArguments("-", "ulong").WithLocation(8, 28),
1722
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-9223372036854775808ul").WithArguments("-", "ulong").WithLocation(9, 28),
Semantics\DelegateTypeTests.cs (1)
3924
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(() => { }).GetType").WithArguments(".", "lambda expression").WithLocation(6, 27)
Semantics\FunctionPointerTests.cs (1)
3166
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "delegate*<void>").WithLocation(7, 12),
Semantics\NativeIntegerTests.cs (8)
5184
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-F1").WithArguments("-", "System.IntPtr").WithLocation(10, 14),
5187
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+F2").WithArguments("+", "System.UIntPtr").WithLocation(11, 14),
5190
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-F3").WithArguments("-", "System.IntPtr?").WithLocation(12, 14),
5193
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+F4").WithArguments("+", "System.UIntPtr?").WithLocation(13, 14),
9541
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, $"{op}operand").WithArguments(op, opType);
9762
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, isPrefix ? op + "operand" : "operand" + op).WithArguments(op, opType);
10137
diagnostic = Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "operand").WithArguments(op, opType);
13149
static DiagnosticDescription[] getBadUnaryOpDiagnostics(string opType, string op, string operand) => new[] { Diagnostic(ErrorCode.
ERR_BadUnaryOp
, operand).WithArguments(op, opType) };
Semantics\NullableReferenceTypesTests.cs (8)
1672
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null!.field").WithArguments(".", "<null>").WithLocation(8, 17),
2019
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!(a.E!)").WithArguments("!", "method group").WithLocation(14, 17),
2037
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!(a.F!)").WithArguments("!", "method group").WithLocation(22, 17),
3499
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(arg => { arg = 2; return arg; } !).ToString").WithArguments(".", "lambda expression").WithLocation(6, 35),
3502
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(delegate { } !).ToString").WithArguments(".", "anonymous method").WithLocation(8, 17)
3522
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(()=> { return 1; } !) ?.ToString()").WithArguments("?", "lambda expression").WithLocation(6, 18),
3525
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(()=> { return 1; } !) ?.ToString()").WithArguments("?", "lambda expression").WithLocation(6, 18)
3642
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "(null, null)! is object").WithArguments("is", "(<null>, <null>)").WithLocation(8, 13),
Semantics\NullConditionalAssignmentTests.cs (3)
325
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "S").WithLocation(25, 10));
547
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "RS").WithLocation(11, 11),
962
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "S?*").WithLocation(8, 11));
Semantics\OperatorTests.cs (4)
2973
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!1").WithArguments("!", "int").WithLocation(7, 12),
2976
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "b++").WithArguments("++", "bool").WithLocation(8, 9),
12121
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1?").WithLocation(3, 10)
12142
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+s1").WithArguments("+", "S1?").WithLocation(3, 10)
Semantics\RefExtensionMethodsTests.cs (2)
335
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "TestType").WithLocation(10, 25));
358
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "TestType").WithLocation(10, 25));
Semantics\SemanticErrorTests.cs (17)
1075
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!q").WithArguments("!", "object").WithLocation(9, 17),
1087
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "obj++").WithArguments("++", "object").WithLocation(16, 13),
1090
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "--obj").WithArguments("--", "object").WithLocation(17, 13),
1154
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+M").WithArguments("+", "method group"),
1156
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "+(() => { })").WithArguments("+", "lambda expression"));
1173
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, ".").WithArguments(".", "void"));
1190
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, ".").WithArguments(".", "void"));
1207
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "null.Length").WithArguments(".", "<null>"));
1226
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "arg => { arg = 2; return arg; }.ToString").WithArguments(".", "lambda expression"),
1227
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "delegate { }.ToString").WithArguments(".", "anonymous method"));
24150
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "int").WithLocation(13, 21),
24156
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "void").WithLocation(17, 24),
24162
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "()=> { return 1; } ?.ToString()").WithArguments("?", "lambda expression").WithLocation(19, 18)
24260
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "int").WithLocation(16, 21),
24266
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "void").WithLocation(20, 24),
24272
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "()=> { return 1; } ?[1,2]").WithArguments("?", "lambda expression").WithLocation(22, 18),
24275
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "?").WithArguments("?", "<null>").WithLocation(24, 22)
Semantics\TargetTypedDefaultTests.cs (1)
2112
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!Main").WithArguments("!", "method group").WithLocation(6, 13),
Semantics\UnsafeTests.cs (1)
11923
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "i1.ToString").WithArguments(".", "int*"));
Semantics\Utf8StringsLiteralsTests.cs (2)
4199
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "x++").WithArguments("++", "System.ReadOnlySpan<byte>").WithLocation(13, 9),
4202
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "y++").WithArguments("++", "System.ReadOnlySpan<byte>").WithLocation(14, 9),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (5)
Symbols\CheckedUserDefinedOperatorsTests.cs (1)
3800
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, op + "x").WithArguments(op, "C0").WithLocation(11, 26)
Symbols\DefaultInterfaceImplementationTests.cs (1)
47269
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "-x").WithArguments("-", "Test2").WithLocation(8, 16)
Symbols\EnumTests.cs (1)
148
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "~e").WithArguments("~", "E"));
Symbols\ExtensionMethodTests.cs (1)
1154
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "!o.E").WithArguments("!", "method group").WithLocation(10, 17),
Symbols\Source\EventTests.cs (1)
1185
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, "E++").WithArguments("++", "System.Action"),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
207
Diagnostic(ErrorCode.
ERR_BadUnaryOp
, @"null.Length").WithArguments(".", "<null>"));