356 references to ERR_UnsafeNeeded
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Unsafe.cs (1)
68
? new CSDiagnosticInfo(ErrorCode.
ERR_UnsafeNeeded
)
Errors\ErrorFacts.cs (1)
729
case ErrorCode.
ERR_UnsafeNeeded
:
Symbols\Source\SourceMemberFieldSymbol.cs (1)
579
diagnosticsForFirstDeclarator.Add(ErrorCode.
ERR_UnsafeNeeded
, declarator.Location);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (7)
CodeGen\CodeGenFunctionPointersTests.cs (4)
11468
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(11, 14));
11517
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(11, 22));
11592
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(3, 16)
11963
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(12, 14));
CodeGen\FixedSizeBufferTests.cs (2)
364
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "s.x").WithLocation(14, 34),
367
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "a[0].x").WithLocation(18, 34)
CodeGen\UnsafeTests.cs (1)
9645
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "c.Field").WithLocation(3, 5)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Attributes\AttributeTests.cs (6)
9882
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "F").WithLocation(8, 28)
9920
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "F").WithLocation(9, 28)
10540
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(5, 7),
10546
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(8, 7),
10601
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(5, 7));
10607
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(5, 7));
Semantics\PatternMatchingTests_Global.cs (2)
6192
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "a[2]").WithLocation(3, 12)
6221
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "a[2]").WithLocation(3, 12),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (16)
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (16)
36
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[1]").WithLocation(6, 27)
64
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[1]").WithLocation(8, 27)
93
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[dimension]").WithLocation(9, 27)
121
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[dimension]").WithLocation(8, 27)
152
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[dimension]").WithLocation(8, 27)
183
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[(int)dimension]").WithLocation(8, 27)
210
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[] { 42 }").WithLocation(6, 27)
237
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[1] { 42 }").WithLocation(6, 27)
323
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc M[] { new M() }").WithLocation(8, 27)
355
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc[] { new M() }").WithLocation(8, 27)
455
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc[] { 2, a, default }").WithLocation(7, 27)
509
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[] { 1 }").WithLocation(6, 27)
541
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[b]").WithLocation(6, 27)
572
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[M()]").WithLocation(6, 27)
606
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[(int)M()]").WithLocation(6, 27)
704
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[0.0]").WithLocation(6, 27)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (253)
Semantics\FunctionPointerTests.cs (2)
51
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(2, 11),
110
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(2, 43));
Semantics\GlobalUsingDirectiveTests.cs (2)
5066
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(4, 5));
5085
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 18));
Semantics\LocalFunctionTests.cs (3)
3096
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "&x").WithLocation(11, 32)
4462
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*").WithLocation(11, 29),
4465
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(void*)null").WithLocation(11, 28),
Semantics\OutVarTests.cs (2)
31970
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "a[2]").WithLocation(3, 12)
32001
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "a[2]").WithLocation(3, 12),
Semantics\RefFieldTests.cs (18)
729
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S*").WithLocation(14, 9),
732
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S2*").WithLocation(15, 9),
738
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "C*").WithLocation(16, 9),
1005
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*").WithLocation(13, 12),
1008
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "_ = (S*)p").WithLocation(15, 9),
1011
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(S*)p").WithLocation(15, 13),
1014
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S*").WithLocation(15, 14),
1017
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "p").WithLocation(15, 17),
1020
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "_ = (S2*)p").WithLocation(16, 9),
1023
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(S2*)p").WithLocation(16, 13),
1026
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S2*").WithLocation(16, 14),
1032
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "p").WithLocation(16, 18),
1035
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "_ = (C*)p").WithLocation(17, 9),
1038
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(C*)p").WithLocation(17, 13),
1041
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "C*").WithLocation(17, 14),
1047
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "p").WithLocation(17, 17),
1239
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "&s").WithLocation(15, 17),
1245
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "&s").WithLocation(19, 17),
Semantics\ScriptSemanticsTests.cs (2)
1143
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[3]").WithLocation(1, 11)
1169
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[3]").WithLocation(1, 11)
Semantics\SemanticErrorTests.cs (2)
15991
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "inst.field.buffer").WithLocation(13, 30),
15994
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "field.buffer").WithLocation(20, 17)
Semantics\StackAllocInitializerTests.cs (4)
1493
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int [3] { 1, 2, 3 }").WithLocation(6, 18),
1496
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int [ ] { 1, 2, 3 }").WithLocation(7, 18),
1499
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc [ ] { 1, 2, 3 }").WithLocation(8, 18)
1829
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc [ ] { d }").WithLocation(9, 18)
Semantics\StackAllocSpanExpressionsTests.cs (1)
415
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[10]").WithLocation(6, 17));
Semantics\TopLevelStatementsTests.cs (3)
8450
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "fixed(int *p = &new C().i) {}").WithLocation(2, 1),
8453
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int *").WithLocation(2, 7),
8456
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "&new C().i").WithLocation(2, 16)
Semantics\UnsafeTests.cs (214)
438
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*")
460
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
480
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
482
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"),
484
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
487
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
489
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"),
491
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
506
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
508
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"),
510
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
525
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
527
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"));
542
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
560
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
562
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"),
564
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "short*"),
566
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"));
586
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
588
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
608
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
610
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
612
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"),
614
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
616
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "long*"),
618
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "byte*"));
671
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(3, 18),
677
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(8, 18),
731
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
734
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
737
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
740
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
743
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
746
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
749
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
752
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe(null)")
814
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
817
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
820
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
823
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
826
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
829
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
832
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
835
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
838
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
841
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
844
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
847
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
874
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
877
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
883
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
886
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Unsafe()"),
889
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*")
923
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1112
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1115
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo()"),
1118
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1121
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo(null)"),
1124
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1127
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1130
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo((int*)1)"),
1133
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1136
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new int*[2]"),
1139
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo(new int*[2])")
1164
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1167
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo()"),
1170
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1173
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo(null)"),
1176
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1179
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1182
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo((int*)1)")
1209
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1212
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d()"),
1215
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1218
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d(null)"),
1221
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1224
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1227
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d((int*)1)"),
1230
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1233
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new int*[2]"),
1236
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d(new int*[2])")
1262
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1265
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d()"),
1268
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1271
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d(null)"),
1274
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1277
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1280
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "d((int*)1)")
1307
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1310
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C()"),
1313
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1316
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C(null)"),
1319
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1322
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1325
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C((int*)1)"),
1328
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1331
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new int*[2]"),
1334
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C(new int*[2])")
1360
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1363
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C()"),
1366
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1369
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C(null)"),
1372
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1375
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1378
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new C((int*)1)")
1405
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1408
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1411
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1"),
1414
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1417
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "new int*[2]")
1443
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1446
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1449
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "(int*)1")
1475
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*")
1508
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*")
1542
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo"),
1546
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1549
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
1592
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*"),
1595
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1598
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Goo(null)")
1630
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1633
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1636
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1639
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "M(null)"),
1642
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1645
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1648
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "M(null, null)"),
1651
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "this"),
1654
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "M(this)")
1686
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1689
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"));
1711
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1714
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "null"),
1717
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "base")
1740
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
1743
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x"));
7566
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
7572
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
7575
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int**"),
7581
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*"),
7587
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*"),
7590
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void**"),
7955
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
7958
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[1]")
8562
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "T*").WithLocation(8, 22),
8666
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "T*").WithLocation(17, 22),
8669
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "T*").WithLocation(10, 22),
8829
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "string*").WithLocation(13, 22),
8832
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "string*").WithLocation(10, 22),
9137
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*"),
9140
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "B"),
9143
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "base"));
9999
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(3, 11),
10002
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(7, 13),
10005
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Y").WithLocation(10, 13));
10025
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(5, 15));
10063
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 11),
10066
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(6, 12));
10120
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 12));
10149
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 11));
10168
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10187
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10239
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10258
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(2, 11),
10261
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10282
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(2, 11),
10285
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(6, 12));
10311
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(8, 13));
10331
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(3, 11));
10350
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10369
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 13));
10463
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43)
10509
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
10512
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 12),
10566
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
10578
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
10613
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43)
10645
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
10648
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 12)
10684
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43));
10690
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
10757
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 5),
10760
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 9),
10763
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(9, 9),
10766
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 17),
10769
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 20)
10809
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 5),
10812
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 9),
10815
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(9, 9),
10818
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 17),
10821
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 20),
10824
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(11, 22),
10827
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 17),
10830
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 25),
10833
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(13, 32)
10843
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 5),
10846
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 9),
10849
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(9, 9),
10852
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 17),
10855
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 20),
10858
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(11, 22),
10861
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 17),
10864
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 25),
10867
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(13, 32)
10874
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 5),
10877
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 9),
10880
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(9, 9),
10883
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 17),
10886
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(11, 20),
10889
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(11, 22),
10892
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 17),
10895
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(13, 25),
10898
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x").WithLocation(13, 32)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (42)
Compilation\UsedAssembliesTests.cs (2)
3694
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S<C0>*").WithLocation(2, 17));
3710
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S<C0>*").WithLocation(2, 17));
Symbols\FunctionPointerTypeSymbolTests.cs (8)
1094
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(4, 5),
1100
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(5, 5),
1103
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(6, 5),
1106
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(6, 23),
1109
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(8, 9),
1115
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate/**/*").WithLocation(9, 13),
1793
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(15, 9),
1796
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "ptr(1)").WithLocation(16, 13)
Symbols\GenericConstraintTests.cs (5)
6483
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "C<int>.E*").WithLocation(4, 30),
6486
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "E*").WithLocation(9, 37));
6506
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "C<U>.E*").WithLocation(4, 33),
6509
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "C<V>.E*").WithLocation(9, 40));
6984
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(6, 15));
Symbols\Source\ClsComplianceTests.cs (1)
409
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(10, 26),
Symbols\Source\EnumTests.cs (2)
937
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 11),
961
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 11),
Symbols\Source\UsingAliasTests.cs (11)
778
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(3, 43),
781
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(8, 12));
804
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[0]").WithLocation(10, 17));
826
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[0]").WithLocation(10, 17),
829
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[0][0]").WithLocation(10, 17));
834
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(3, 43),
837
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(8, 12),
840
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[0]").WithLocation(10, 17),
843
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "x[0][0]").WithLocation(10, 17));
865
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 43),
868
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 12)
Symbols\SymbolErrorTests.cs (13)
2836
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "S*"),
2839
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "&s"),
2842
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "s2"));
2866
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "s.x"),
2869
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "s.x"));
2883
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "buf[10]"));
2905
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[10]").WithLocation(8, 21));
4382
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(7, 15),
4400
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(11, 11),
4500
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 21),
4506
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "COfIntPtr").WithLocation(9, 13),
4509
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(10, 21),
15363
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "ab[10]");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (27)
Parsing\AnonymousFunctionParsingTests.cs (8)
1879
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
1895
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
1985
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
2013
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
2120
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 1),
2133
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 1),
2209
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
2219
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 22),
Parsing\FileModifierParsingTests.cs (1)
735
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(3, 10),
Parsing\FunctionPointerTests.cs (1)
519
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 1),
Parsing\ParserErrorMessageTests.cs (3)
1121
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "T*").WithLocation(2, 15),
1124
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "T*").WithLocation(9, 19));
4130
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "Test1*").WithLocation(6, 15),
Parsing\ParsingErrorRecoveryTests.cs (1)
3930
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "fixed(t v;").WithLocation(1, 22),
Parsing\StackAllocInitializerParsingTests.cs (3)
31
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[] { 42 }").WithLocation(1, 30));
78
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc int[1] { 42 }").WithLocation(1, 30));
125
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "stackalloc[] { 42 }").WithLocation(1, 30));
Parsing\UsingDirectiveParsingTests.cs (8)
624
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "A*").WithLocation(1, 11));
728
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 11));
1123
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(1, 11));
1212
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 15));
1357
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "int*").WithLocation(2, 11),
1435
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "X").WithLocation(6, 15));
2149
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "VP").WithLocation(5, 12));
2301
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "void*").WithLocation(1, 12));
Syntax\SyntaxFactoryTests.cs (2)
627
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 1),
638
Diagnostic(ErrorCode.
ERR_UnsafeNeeded
, "delegate*").WithLocation(1, 1),