126 references to UsingStatement
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (126)
Parsing\AnonymousFunctionParsingTests.cs (8)
901
UsingStatement
(test);
969
UsingStatement
(test);
1032
UsingStatement
(test);
1102
UsingStatement
(test);
1174
UsingStatement
(test);
1807
UsingStatement
(test);
2126
UsingStatement
(test);
2212
UsingStatement
(test);
Parsing\CollectionExpressionParsingTests.cs (8)
5638
UsingStatement
("var x = (A<B>)[1];");
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 (26)
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) {}");
870
UsingStatement
("foreach (_ 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 (6)
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;");
3198
UsingStatement
(@"var* (x, y) = e;");
3304
UsingStatement
(@"var?.var (x, y) = e;");
Parsing\ExpressionParsingTests.cs (1)
4840
UsingStatement
(source);
Parsing\ForStatementParsingTest.cs (48)
16
UsingStatement
("for (int i = 0, j = 0; i < 10; i++) ;");
309
UsingStatement
("for (int i = 0, j; i < 10; i++) ;");
447
UsingStatement
("""
513
UsingStatement
("""
587
UsingStatement
("""
961
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
("""
3759
UsingStatement
("""
3793
UsingStatement
("""
3839
UsingStatement
("""
3885
UsingStatement
("""
4064
UsingStatement
("""
4116
UsingStatement
("""
4168
UsingStatement
("""
4214
UsingStatement
("""
4296
UsingStatement
("""
4403
UsingStatement
("""
4454
UsingStatement
("""
4476
UsingStatement
("""
4509
UsingStatement
("""
4552
UsingStatement
("""
4593
UsingStatement
("""
4626
UsingStatement
("""
4669
UsingStatement
("""
4728
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\NullableParsingTests.cs (6)
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\StatementParsingTests.cs (9)
3974
UsingStatement
("switch (a: 0, b: 4) {}");
4064
UsingStatement
("_ = new (int, int)? {};");
4182
UsingStatement
("int []* p;");
4220
UsingStatement
("int?* p;");
4250
UsingStatement
("_ = new int? {};");
5492
UsingStatement
("""
5604
UsingStatement
("""
5670
UsingStatement
("""
5740
UsingStatement
("""
Parsing\SwitchExpressionParsingTests.cs (1)
2574
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);");