Semantics\GlobalUsingDirectiveTests.cs (96)
2216comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected);
2219comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDeclarationDiagnostics().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected);
2301comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2308comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2338comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2341comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2344comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2635comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2642comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2671comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2674comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2677comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2789comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2796comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2825comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2828comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
2831comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDeclarationDiagnostics().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2906comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
2907comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
2910comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
2911comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
2914comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3);
2915comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2);
2918comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1);
2992comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
2993comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
2996comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
2997comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
3000comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3);
3001comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2);
3004comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1);
3078comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
3079comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
3082comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3);
3083comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2);
3086comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3);
3087comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2);
3090comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1);
3245comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1);
3248comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
3251comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0);
3256comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[0].Length - 1)).Verify(
3264comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[1].Length - 1)).Verify(
3272comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[2].Length - 1)).Verify(
3285comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1);
3286AssertEx.SetEqual(new[] { comp2.SyntaxTrees[1] }, comp2.UsageOfUsingsRecordedInTrees);
3287comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1);
3288AssertEx.SetEqual(new[] { comp2.SyntaxTrees[1] }, comp2.UsageOfUsingsRecordedInTrees);
3290comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
3291AssertEx.SetEqual(new[] { comp2.SyntaxTrees[1], comp2.SyntaxTrees[2] }, comp2.UsageOfUsingsRecordedInTrees);
3292comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
3293AssertEx.SetEqual(new[] { comp2.SyntaxTrees[1], comp2.SyntaxTrees[2] }, comp2.UsageOfUsingsRecordedInTrees);
3295comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0);
3297comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0);
3302comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1);
3303AssertEx.SetEqual(new[] { comp2.SyntaxTrees[1] }, comp2.UsageOfUsingsRecordedInTrees);
3305comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0);
3308comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
3313comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0);
3316comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1);
3319comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
3840var tree = comp.SyntaxTrees[0];
3866tree = comp.SyntaxTrees[0];
3888tree = comp.SyntaxTrees[1];
3897tree = comp.SyntaxTrees[0];
3916tree = comp.SyntaxTrees[1];
3930tree = comp.SyntaxTrees[0];
3950tree = comp.SyntaxTrees[0];
3966tree = comp.SyntaxTrees[1];
3975tree = comp.SyntaxTrees[0];
3988tree = comp.SyntaxTrees[1];
4002tree = comp.SyntaxTrees[0];
4022tree = comp.SyntaxTrees[0];
4038tree = comp.SyntaxTrees[1];
4047tree = comp.SyntaxTrees[0];
4060tree = comp.SyntaxTrees[1];
4074tree = comp.SyntaxTrees[0];
4088tree = comp.SyntaxTrees[0];
4098tree = comp.SyntaxTrees[1];
4109tree = comp.SyntaxTrees[0];
4131tree = comp.SyntaxTrees[0];
4147tree = comp.SyntaxTrees[0];
4242var tree = comp.SyntaxTrees[0];
4250tree = comp.SyntaxTrees[0];
4278tree = comp.SyntaxTrees[0];
4286tree = comp.SyntaxTrees[0];
4294tree = comp.SyntaxTrees[0];
4302tree = comp.SyntaxTrees[0];
4314tree = comp.SyntaxTrees[0];
4977var tree = comp.SyntaxTrees[0];
4982tree = comp.SyntaxTrees[1];
Semantics\TopLevelStatementsTests.cs (57)
181verifyModel(comp, comp.SyntaxTrees[0]);
184verifyModel(comp, comp.SyntaxTrees[0], nullableEnabled: true);
291verifyModel(comp, comp.SyntaxTrees[0], comp.SyntaxTrees[1]);
306verifyModel(comp, comp.SyntaxTrees[1], comp.SyntaxTrees[0]);
309verifyModel(comp, comp.SyntaxTrees[0], comp.SyntaxTrees[1], nullableEnabled: true);
372var isInvalid = comp.SyntaxTrees[1] == tree2 ? ", IsInvalid" : "";
453verifyModel(comp, comp.SyntaxTrees[0], comp.SyntaxTrees[1]);
474verifyModel(comp, comp.SyntaxTrees[1], comp.SyntaxTrees[0]);
528var tree1 = comp.SyntaxTrees[0];
566verifyModel(comp, comp.SyntaxTrees[0]);
696var tree = comp.SyntaxTrees.Single();
869var tree1 = comp.SyntaxTrees[0];
875var tree2 = comp.SyntaxTrees[1];
983var tree1 = comp.SyntaxTrees[0];
1038var tree1 = comp.SyntaxTrees[0];
1405var tree2 = comp.SyntaxTrees[1];
1423tree2 = comp.SyntaxTrees[0];
1519var tree = comp.SyntaxTrees.Single();
1589var tree = comp.SyntaxTrees[0];
1683var tree1 = comp.SyntaxTrees[0];
1713var tree = comp.SyntaxTrees[0];
1856var tree1 = comp.SyntaxTrees[0];
1879var tree2 = comp.SyntaxTrees[1];
2082var tree1 = comp.SyntaxTrees[0];
2246var tree1 = comp.SyntaxTrees[0];
2264var tree2 = comp.SyntaxTrees[1];
2424var tree1 = comp.SyntaxTrees[0];
2916var tree1 = comp.SyntaxTrees[0];
2939var tree2 = comp.SyntaxTrees[1];
3939var tree = comp.SyntaxTrees[0];
4088var tree = comp.SyntaxTrees[1];
4213var tree = comp.SyntaxTrees.Single();
4508var tree1 = comp.SyntaxTrees[0];
4514var tree2 = comp.SyntaxTrees[1];
4572var tree1 = comp.SyntaxTrees[0];
4621var tree1 = comp.SyntaxTrees[0];
4891var tree = comp.SyntaxTrees.Single();
4948var tree1 = comp.SyntaxTrees[0];
4954var tree2 = comp.SyntaxTrees[1];
4976var tree = comp.SyntaxTrees.Single();
6027var tree1 = comp.SyntaxTrees[0];
6231var syntaxTree = comp.SyntaxTrees.Single();
6275var syntaxTree = comp.SyntaxTrees.Single();
6315var syntaxTree1 = comp.SyntaxTrees.Single();
6365var syntaxTree1 = comp.SyntaxTrees.First();
6367var syntaxTree2 = comp.SyntaxTrees[1];
8576var tree = comp.SyntaxTrees.Single();
8649var tree = comp.SyntaxTrees.Single();
8671var tree = comp.SyntaxTrees.Single();
8693var tree = comp.SyntaxTrees.Single();
9676var tree = compilation.SyntaxTrees[0];
9701var tree = compilation.SyntaxTrees[0];
Semantics\UninitializedNonNullableFieldTests.cs (10)
2465comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[0], filterSpanWithinTree: null, includeEarlierStages: true)
2468comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[1], filterSpanWithinTree: null, includeEarlierStages: true)
2495comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[0], filterSpanWithinTree: null, includeEarlierStages: true)
2501comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[1], filterSpanWithinTree: null, includeEarlierStages: true)
2533comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[0], filterSpanWithinTree: null, includeEarlierStages: true)
2536comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[1], filterSpanWithinTree: null, includeEarlierStages: true)
2559comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[0], filterSpanWithinTree: null, includeEarlierStages: true)
2565comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[1], filterSpanWithinTree: null, includeEarlierStages: true)
2597comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[0], filterSpanWithinTree: null, includeEarlierStages: true)
2600comp.GetDiagnosticsForSyntaxTree(CompilationStage.Compile, comp.SyntaxTrees[1], filterSpanWithinTree: null, includeEarlierStages: true)