78 references to UsingStatement
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (78)
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\LambdaAttributeParsingTests.cs (5)
3369
UsingStatement
(source);
3396
UsingStatement
(source);
3435
UsingStatement
(source);
3472
UsingStatement
(source);
3519
UsingStatement
(source);
Parsing\LambdaParameterParsingTests.cs (1)
5082
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);");