188 references to UsingStatement
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (188)
Parsing\AnonymousFunctionParsingTests.cs (14)
901
UsingStatement
(test);
969
UsingStatement
(test);
1032
UsingStatement
(test);
1102
UsingStatement
(test);
1174
UsingStatement
(test);
1338
UsingStatement
(test,
1415
UsingStatement
(test,
1614
UsingStatement
(test,
1718
UsingStatement
(test,
1807
UsingStatement
(test);
1906
UsingStatement
(test,
2036
UsingStatement
(test,
2126
UsingStatement
(test);
2212
UsingStatement
(test);
Parsing\CollectionExpressionParsingTests.cs (9)
5638
UsingStatement
("var x = (A<B>)[1];");
7080
UsingStatement
("A < B?[] > D",
18108
UsingStatement
("var v = x is Y ? [1, 2, 3] : [1];");
18192
UsingStatement
("var v = x is Y ? [] : [1];");
18253
UsingStatement
("var v = x is Y ? [];");
18308
UsingStatement
("var v = x is Y ? [,];");
18368
UsingStatement
("var v = x is Y ? [][];");
18432
UsingStatement
("var v = x is Y ? [] == Complex() : [1];");
18509
UsingStatement
("var v = x is Y ? [Goo]() => B : [Goo]() => C;");
Parsing\DeclarationExpressionTests.cs (28)
22
UsingStatement
("M(out int? x);");
64
UsingStatement
("if (e is int?) {}");
98
UsingStatement
("if (e is int ? true : false) {}");
141
UsingStatement
("if (e is int? x) {}");
183
UsingStatement
("if (e is int ? x : y) {}");
227
UsingStatement
("if (e is int x ? true : false) {}");
277
UsingStatement
("ref object x = o1 is string ? ref o2 : ref o3;");
340
UsingStatement
("ref object x = ref o1 is string ? ref o2 : ref o3;");
407
UsingStatement
("foreach (int _ in e) {}");
435
UsingStatement
("foreach (var _ in e) {}");
463
UsingStatement
("foreach ((var x, var y) in e) {}");
520
UsingStatement
("foreach ((int x, int y) in e) {}");
577
UsingStatement
("foreach ((int x, int y) v in e) {}");
624
UsingStatement
("foreach ((1, 2) in e) {}");
667
UsingStatement
("foreach (var (x, y) in e) {}");
711
UsingStatement
("foreach ((int x, var (y, z)) in e) {}");
779
UsingStatement
("foreach ((var (x, y), z) in e) {}");
839
UsingStatement
("foreach (x in e) {}",
870
UsingStatement
("foreach (_ in e) {}");
897
UsingStatement
("foreach (a.b in e) {}",
936
UsingStatement
("(1, 2) = e;");
975
UsingStatement
("M(out (1, 2));");
1022
UsingStatement
("M(out (x, y));");
1069
UsingStatement
("M(out (1, 2).Field);");
1125
UsingStatement
("M(out (int x, int y));");
1187
UsingStatement
("M(out (var x, var y));");
1248
UsingStatement
("(x: 1, y: 2) = e;");
1303
UsingStatement
("var(1, 2) = e;");
Parsing\DeconstructionTests.cs (8)
2930
UsingStatement
(@"var (x, y) = e;");
2970
UsingStatement
(@"var::var (x, y) = e;");
3024
UsingStatement
(@"var.var (x, y) = e;");
3078
UsingStatement
(@"var<var> (x, y) = e;");
3133
UsingStatement
(@"var[] (x, y) = e;",
3198
UsingStatement
(@"var* (x, y) = e;");
3245
UsingStatement
(@"var? (x, y) = e;",
3304
UsingStatement
(@"var?.var (x, y) = e;");
Parsing\ExpressionParsingTests.cs (2)
4840
UsingStatement
(source);
6381
UsingStatement
("for (int i = 0; ref; i++) { }",
Parsing\ForStatementParsingTest.cs (75)
16
UsingStatement
("for (int i = 0, j = 0; i < 10; i++) ;");
88
UsingStatement
("for (int i = 0, i < 10; i++) ;",
150
UsingStatement
("for (int i = 0, i < 10, i++) ;",
215
UsingStatement
("for (int i = 0, i) ;",
264
UsingStatement
("for (int i = 0,,) ;",
309
UsingStatement
("for (int i = 0, j; i < 10; i++) ;");
373
UsingStatement
("for (int i = 0, i++; i < 10; i++) ;",
447
UsingStatement
("""
513
UsingStatement
("""
587
UsingStatement
("""
661
UsingStatement
("""
730
UsingStatement
("""
804
UsingStatement
("""
884
UsingStatement
("""
961
UsingStatement
("""
1017
UsingStatement
("""
1134
UsingStatement
("""
1248
UsingStatement
("""
1370
UsingStatement
("""
1495
UsingStatement
("""
1628
UsingStatement
("""
1757
UsingStatement
("""
1845
UsingStatement
("""
1937
UsingStatement
("""
2030
UsingStatement
("""
2133
UsingStatement
("""
2237
UsingStatement
("""
2338
UsingStatement
("""
2402
UsingStatement
("""
2451
UsingStatement
("""
2548
UsingStatement
("""
2606
UsingStatement
("""
2664
UsingStatement
("""
2725
UsingStatement
("""
2777
UsingStatement
("""
2814
UsingStatement
("""
2884
UsingStatement
("""
2936
UsingStatement
("""
2970
UsingStatement
("""
3049
UsingStatement
("""
3104
UsingStatement
("""
3141
UsingStatement
("""
3199
UsingStatement
("""
3278
UsingStatement
("""
3312
UsingStatement
("""
3370
UsingStatement
("""
3419
UsingStatement
("""
3465
UsingStatement
("""
3526
UsingStatement
("""
3602
UsingStatement
("""
3663
UsingStatement
("""
3709
UsingStatement
("""
3759
UsingStatement
("""
3793
UsingStatement
("""
3839
UsingStatement
("""
3885
UsingStatement
("""
3943
UsingStatement
("""
4005
UsingStatement
("""
4064
UsingStatement
("""
4116
UsingStatement
("""
4168
UsingStatement
("""
4214
UsingStatement
("""
4296
UsingStatement
("""
4348
UsingStatement
("""
4403
UsingStatement
("""
4454
UsingStatement
("""
4476
UsingStatement
("""
4509
UsingStatement
("""
4552
UsingStatement
("""
4593
UsingStatement
("""
4626
UsingStatement
("""
4669
UsingStatement
("""
4728
UsingStatement
("""
4803
UsingStatement
("""
4847
UsingStatement
("""
Parsing\LambdaAttributeParsingTests.cs (5)
3362
UsingStatement
(source);
3389
UsingStatement
(source);
3428
UsingStatement
(source);
3465
UsingStatement
(source);
3512
UsingStatement
(source);
Parsing\LambdaParameterParsingTests.cs (1)
5077
UsingStatement
(@"F(async () => await Task.FromResult(4));");
Parsing\LambdaReturnTypeParsingTests.cs (2)
3058
UsingStatement
(source);
3098
UsingStatement
(source);
Parsing\LocalFunctionParsingTests.cs (1)
877
UsingStatement
(statement,
Parsing\NullableParsingTests.cs (7)
684
UsingStatement
("switch (e) { case T? t: break; }",
896
UsingStatement
("switch (e) { case T?[] t: break; }");
955
UsingStatement
("switch (e) { case T[]?[] t: break; }");
1091
UsingStatement
("(object[]?, A[]?) t;");
1161
UsingStatement
("using (A[]? a = b) { }");
1783
UsingStatement
("_ = x is Type?;");
1819
UsingStatement
("_ = x is Type? t;");
Parsing\RefReadonlyTests.cs (1)
456
UsingStatement
("new ref[];",
Parsing\StatementParsingTests.cs (27)
30
UsingStatement
("private",
3562
UsingStatement
(@"{ label: public",
3594
UsingStatement
("else {}",
3648
UsingStatement
("{ else {} else {} }",
3752
UsingStatement
("{ if (a) { } else { } else { } }",
3835
UsingStatement
("if (a) else {}",
3898
UsingStatement
("switch 1+2 {}",
3929
UsingStatement
("switch (a: 0) {}",
3974
UsingStatement
("switch (a: 0, b: 4) {}");
4023
UsingStatement
("switch (1) + (2) {}",
4064
UsingStatement
("_ = new (int, int)? {};");
4116
UsingStatement
("_ = new (int, int) ? (x) : (y);",
4182
UsingStatement
("int []* p;");
4220
UsingStatement
("int?* p;");
4250
UsingStatement
("_ = new int? {};");
4771
UsingStatement
("""
4892
UsingStatement
("""
5019
UsingStatement
("""
5174
UsingStatement
("""
5235
UsingStatement
("""
5312
UsingStatement
("""
5406
UsingStatement
("""
5492
UsingStatement
("""
5542
UsingStatement
("""
5604
UsingStatement
("""
5670
UsingStatement
("""
5740
UsingStatement
("""
Parsing\SwitchExpressionParsingTests.cs (3)
288
UsingStatement
("""
2574
UsingStatement
(code);
2661
UsingStatement
(code,
Parsing\ValueTupleTests.cs (5)
731
UsingStatement
("return (i, isValid ? Errors.IsValid : Errors.HasErrors);");
792
UsingStatement
("return (isValid ? Errors.IsValid : Errors.HasErrors, i);");
853
UsingStatement
("return (i, a < b, c > d);");
906
UsingStatement
("return (i, a < b, c > d.x);");
970
UsingStatement
("return (i, a < b, c > d && x);");