1366 references to WithLanguageVersion
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
222CSharpParseOptions options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
222CSharpParseOptions options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CSharpCompiler.cs (2)
221parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp8); 225parseOptions = parseOptions.WithLanguageVersion(languageVersion);
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (2)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (1)
98return parseOptions.WithLanguageVersion(LanguageVersion);
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (1)
106return parseOptions.WithLanguageVersion(LanguageVersion);
Microsoft.CodeAnalysis.CSharp (1)
CSharpParseOptions.cs (1)
35/// the call to the constructor, or modified using the <see cref="WithLanguageVersion"/> method,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 114project.CanApplyParseOptionChange(parseOptions, parseOptions.WithLanguageVersion(parsedNewVersion));
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (76)
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (5)
2810""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2920""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2936""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp12)); 2962""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2978""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp12));
src\Analyzers\CSharp\Tests\GenerateConstructor\GenerateConstructorTests.cs (4)
3664parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3694parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3724parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3754parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (4)
8775parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8807parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8839parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8871parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (1)
231""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
174""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (2)
30private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 31private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (2)
25CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3); 75await TestMissingInRegularAndScriptAsync(text, new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)));
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (2)
8938parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8961parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (2)
43parseOptions: CSharpParseOptions.Default.WithLanguageVersion(version)); 52new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (4)
25private readonly ParseOptions CSharp12 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12); 449CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 469""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 515""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests_Field.cs (2)
17private readonly ParseOptions CSharp13 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); 18private readonly ParseOptions Preview = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (7)
22private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 23private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 163""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1008""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1074""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1109""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1144""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)));
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
3367""", new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), options: ImplicitTypeEverywhere()));
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (3)
30CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest); 87""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 103""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (7)
95new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 115new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 175""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 205""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 235""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 265""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 283""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (6)
26private static readonly ParseOptions CSharp7 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7); 27private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 28private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 99new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 119new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 287""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (4)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 53""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 4165parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10)); 4181new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (10)
80""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version))); 98""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1166""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1205""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1471""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1502""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1557""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1589""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1652""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1694""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests_FixAllTests.cs (2)
72""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 129""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
77""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (4)
150""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 617""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 653""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 690""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (17)
CodeActions\GenerateType\GenerateTypeTests.cs (1)
5592parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10),
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3240var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest);
ExtractInterface\ExtractInterfaceTests.cs (4)
501parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), 541parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), 582parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), 893parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10),
Formatting\FormattingEngineTests.cs (6)
2712AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2737AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2762AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2782AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2802AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2822AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12));
Formatting\Indentation\SmartIndenterTests.cs (4)
3331options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3351options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3372options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3393options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12));
GenerateConstructors\GenerateConstructorsTests.cs (1)
1386parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6),
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
25protected static readonly CSharpParseOptions CSharp9ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (105)
CodeGen\CodeGenAsyncMainTests.cs (48)
40var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe.WithMainTypeName("Program"), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 65var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 93var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe.WithMainTypeName("Program"), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 118var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 159var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 202var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 233var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 270var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 306var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 337var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 381var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 421var sourceCompilation = CreateEmptyCompilation(source, new[] { corCompilation.ToMetadataReference(), taskCompilation.ToMetadataReference() }, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 449var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 467var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 489var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 508var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 526var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 544var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 566var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 584var c = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 601var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 623var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 645var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 667var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 690var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 712var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 789var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 809var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 831var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 858var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 883var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 903var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 923var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 945var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 967var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 987var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 1007var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 1029var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 1052var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 1074CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 1142var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)).VerifyDiagnostics(); 1164var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 1220var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 1273var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseDebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)).VerifyDiagnostics( 1310var compilation = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseDebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)).VerifyDiagnostics( 1411var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 1465var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 1520var sourceCompilation = CreateCompilationWithMscorlib40(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
CodeGen\CodeGenAwaitForeachTests.cs (2)
8099var comp = CreateCompilationWithMscorlib46(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 8132var comp = CreateCompilationWithMscorlib46(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
CodeGen\CodeGenDeconstructTests.cs (18)
1636parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 1685sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 3343parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 5371var comp = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6), options: TestOptions.DebugExe, references: s_valueTupleRefs); 8777parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8782parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8802parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8807parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8828parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8833parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8863parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8868parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8889parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8894parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8932parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8939parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 8987parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 8993parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
CodeGen\CodeGenExprLambdaTests.cs (1)
3839CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(
CodeGen\CodeGenRefLocalTests.cs (1)
4003var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
CodeGen\CodeGenRefReturnTests.cs (5)
2304var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 2339var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 2381var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 2402var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 2431var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
CodeGen\CodeGenStackAllocInitializerTests.cs (15)
50parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 123parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 214", options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3)); 313parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 369parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 410parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 429parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 493parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 528parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 568parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 670parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 726parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3), 869", options: TestOptions.UnsafeReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3)); 1050", options: TestOptions.UnsafeReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3)); 1699parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3),
CodeGen\CodeGenTupleTest.cs (14)
3945var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 3971var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)); 4029var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 4050var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 4077var comp7 = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)); 4084var verifier7_1 = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 4105var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), 25688var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25733var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25759var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25804var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25830var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25869var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), 25902var comp = CreateEmptyCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1),
CodeGen\WinMdDelegateTests.cs (1)
57parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
Emit\EditAndContinue\EditAndContinueClosureTests.cs (2)
817}", options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 834}", options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
Emit\EditAndContinue\LocalSlotMappingTests.cs (3)
5048var source0 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5049var source1 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5050var source2 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
PDB\CSharpDeterministicBuildCompilationTests.cs (3)
357yield return parseOptions.WithLanguageVersion(LanguageVersion.CSharp9); 358yield return parseOptions.WithLanguageVersion(LanguageVersion.Latest); 359yield return parseOptions.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (151)
Attributes\AttributeTests_Dynamic.cs (1)
911parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview),
Attributes\AttributeTests_RefSafetyRules.cs (3)
95comp = CreateCompilation(source, references: new[] { ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 171var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 181comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB));
Diagnostics\GetDiagnosticsTests.cs (1)
409var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000));
FieldKeywordTests.cs (13)
682parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 843parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 952parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 1065parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 1162parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 1487parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 8362parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 8505parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 8594parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 8669parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10199parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10302parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10401parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion),
FirstClassSpanTests.cs (93)
222var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 258var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 280var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 340var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 393var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 630var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 743var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 770var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 804var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 834var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 916var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 997var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 1069var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 1099CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1118CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1132var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 1162CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1181CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1195var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 1225CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1244CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 1925var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 2003parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 2902CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 2918CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 2933CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 2956CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)) 2979CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 2995CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3011CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3027CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics(); 3041CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3060CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3076CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3092CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3108CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics(); 3122CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3140CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3163CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify) 3235CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3253CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3277CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify) 3308CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify) 3339CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify) 3367CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3383CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3399CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3422CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify) 3452CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)) 3723CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics(); 3835CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3869CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 3965CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), targetFramework: TargetFramework.Net90).VerifyDiagnostics( 3996CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4043CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4204CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4272CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4332CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4357CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4373CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4389CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4407CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4432CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4448CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4464CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4487var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 4519var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion), verify: Verification.FailsILVerify); 4550var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 4582var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 4703var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 4856CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4892CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 4916CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5146CreateCompilationWithSpanAndMemoryExtensions(source, TestOptions.UnsafeReleaseExe, TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5281var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5366var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5374CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5388var comp = CreateCompilation([source, source2], parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5412CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5435CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5531var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5549var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5581var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5612CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5723CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5749var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5774CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5793var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 5820CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5837CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5858CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 5888CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)).VerifyDiagnostics( 6216var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion));
RefReadonlyParameterTests.cs (2)
3728CreateCompilation(new[] { source1, source2 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 3758CompileAndVerify(new[] { source1, source3 }, expectedOutput: "256 256 156 156", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics();
Semantics\CollectionExpressionTests.cs (3)
150var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 2309CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(version)).VerifyDiagnostics( 22697var comp = CreateCompilation(new[] { sourceA, CollectionBuilderAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp10), targetFramework: TargetFramework.Net60);
Semantics\OutVarTests.cs (3)
50var compilation = CreateCompilation(text, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 82var compilation = CreateCompilation(text, options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 599var compilation = CreateCompilation(text, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
Semantics\PatternMatchingTests3.cs (32)
2093var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2165var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2237var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2286var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2335var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2366var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.ReleaseExe); 2424var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.ReleaseExe); 2470var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2501var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2541var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2579var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2608var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2650var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), options: TestOptions.DebugExe); 2666var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2692var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2720var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2743var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2814var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2873var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2914var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2971var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 3000var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 3071var compilation = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 3140var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 3278var compilation = CreateCompilation(source + _iTupleSource, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 3366var compilation = CreateCompilation(source + _iTupleSource, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 4617var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 4783var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 4875var compilation = CreateCompilation(source, options: TestOptions.DebugDll, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 4969var compilation = CreateCompilation(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 5253var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 5322var compilation = CreateCompilation(source, options: TestOptions.DebugExe.WithAllowUnsafe(true), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9));
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 114project.CanApplyParseOptionChange(parseOptions, parseOptions.WithLanguageVersion(parsedNewVersion));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (129)
ConvertAnonymousType\ConvertAnonymousTypeToClassTests.cs (1)
20private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
ConvertAutoPropertyToFullProperty\ConvertAutoPropertyToFullPropertyTests.cs (1)
19private static readonly CSharpParseOptions s_preview = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
ConvertLocalFunctionToMethod\ConvertLocalFunctionToMethodTests.cs (2)
375""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 414""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7));
EditAndContinue\Helpers\EditingTestBase.cs (1)
132CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12),
ExtractMethod\ExtractLocalFunctionTests.cs (11)
3575""", CodeActionIndex, new TestParameters(options: Option(CSharpCodeStyleOptions.PreferStaticLocalFunction, CodeStyleOption2.TrueWithSilentEnforcement), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3))); 3606""", CodeActionIndex, new TestParameters(options: Option(CSharpCodeStyleOptions.PreferStaticLocalFunction, CodeStyleOption2.TrueWithSilentEnforcement), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7))); 3637""", CodeActionIndex, new TestParameters(options: Option(CSharpCodeStyleOptions.PreferStaticLocalFunction, CodeStyleOption2.TrueWithSilentEnforcement), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp8))); 3668""", CodeActionIndex, new TestParameters(options: Option(CSharpCodeStyleOptions.PreferStaticLocalFunction, CodeStyleOption2.TrueWithSilentEnforcement), parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest))); 4122await TestExactActionSetOfferedAsync(code, [FeaturesResources.Extract_method], new TestParameters(parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6))); 4138await TestExactActionSetOfferedAsync(code, [FeaturesResources.Extract_method], new TestParameters(parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5))); 5422await TestAsync(code, expected, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp9)); 5574await TestAsync(code, expected, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp7), index: CodeActionIndex); 5623await TestAsync(code, expected, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp7), index: CodeActionIndex); 5674await TestAsync(code, expected, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp7), index: CodeActionIndex); 5711await TestAsync(code, expected, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp7), index: CodeActionIndex);
ExtractMethod\ExtractMethodCodeRefactoringTests.cs (2)
5216""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 5245""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
GenerateVariable\GenerateVariableTests.cs (3)
9998""" + TestResources.NetFX.ValueTuple.tuplelib_cs, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 10042""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 10088""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12));
InlineTemporary\InlineTemporaryTests.cs (9)
411""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)); 441""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)); 4329new TestParameters(parseOptions: TestOptions.Regular.WithLanguageVersion(version))); 5094await TestMissingInRegularAndScriptAsync(code, new TestParameters(parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp8))); 5669""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5691await TestAsync(code, expected, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 5711await TestAsync(code, expected, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 5730TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 5810await TestInRegularAndScriptAsync(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
IntroduceUsingStatement\IntroduceUsingStatementTests.cs (1)
41=> TestInRegularAndScriptAsync(initialMarkup, expectedMarkup, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion), options: options);
IntroduceVariable\IntroduceVariableTests.cs (7)
5535await TestAsync(code, expected, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 5787await TestAsync(code, expected, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest)); 5820await TestAsync(code, expected, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest)); 5854await TestAsync(code, expected, index: 1, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest)); 6139""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest)); 6169""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), index: 0); 6198""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), index: 2);
InvertLogical\InvertLogicalTests.cs (3)
19private static readonly ParseOptions CSharp6 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6); 20private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 21private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9);
MakeLocalFunctionStatic\MakeLocalFunctionStaticRefactoringTests.cs (2)
22private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 23private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs (2)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 30private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (2)
1453""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1468""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
SimplifyTypeNames\SimplifyTypeNamesTests.cs (3)
5124parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 7234source, new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), options: featureOptions)); 7307source, new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), options: featureOptions));
src\Analyzers\CSharp\Tests\AddParameter\AddParameterTests.cs (5)
2810""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2920""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2936""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp12)); 2962""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 2978""", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp12));
src\Analyzers\CSharp\Tests\GenerateConstructor\GenerateConstructorTests.cs (4)
3664parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3694parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3724parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 3754parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (4)
8775parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8807parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8839parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6)); 8871parseOptions: TestOptions.Regular.WithLanguageVersion(CodeAnalysis.CSharp.LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (1)
231""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
174""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (2)
30private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 31private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (2)
25CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3); 75await TestMissingInRegularAndScriptAsync(text, new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)));
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (2)
8938parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8961parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (2)
43parseOptions: CSharpParseOptions.Default.WithLanguageVersion(version)); 52new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (4)
25private readonly ParseOptions CSharp12 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12); 449CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 469""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 515""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests_Field.cs (2)
17private readonly ParseOptions CSharp13 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); 18private readonly ParseOptions Preview = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (7)
22private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 23private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 163""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1008""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1074""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1109""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1144""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)));
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
3367""", new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), options: ImplicitTypeEverywhere()));
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (3)
30CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest); 87""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 103""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (7)
95new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 115new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 175""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 205""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 235""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 265""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 283""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (6)
26private static readonly ParseOptions CSharp7 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7); 27private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 28private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 99new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 119new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 287""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (4)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 53""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 4165parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10)); 4181new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (10)
80""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version))); 98""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1166""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1205""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1471""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1502""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1557""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1589""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1652""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1694""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests_FixAllTests.cs (2)
72""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 129""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
77""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (4)
150""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 617""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 653""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9)); 690""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9));
UseExpressionBody\Refactoring\UseExpressionBodyForPropertiesRefactoringTests.cs (1)
308}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6),
UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzerTests.cs (1)
26private static readonly ParseOptions CSharp9 = TestOptions.RegularPreview.WithLanguageVersion(LanguageVersion.CSharp9);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs (1)
64""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (270)
Semantics\AwaitExpressionTests.cs (1)
154var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
Semantics\BindingAsyncTests.cs (6)
985CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 993CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(); 1017CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 1022CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(); 3517CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 3534var comp = CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseExe, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7));
Semantics\ConstantTests.cs (1)
3280CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(
Semantics\DelegateTypeTests.cs (8)
6487CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6526CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6571CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6616CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6661CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6706CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6745CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6784CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion),
Semantics\DynamicTests.cs (4)
3107CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source, options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)) }).VerifyDiagnostics( 3224CreateCompilationWithMscorlib40AndSystemCore(new[] { Parse(source, options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)) }).VerifyDiagnostics( 3774CreateCompilationWithMscorlib40AndSystemCore(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp4)).VerifyDiagnostics(); 3775CreateCompilationWithMscorlib40AndSystemCore(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3)).VerifyDiagnostics(
Semantics\ImplicitlyTypedLocalsTests.cs (2)
152CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3)).VerifyDiagnostics(); 153CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp2)).VerifyDiagnostics(
Semantics\InterpolationTests.cs (6)
14940var comp = CreateCompilation(new[] { code, InterpolatedStringHandlerAttribute, InterpolatedStringHandlerArgumentAttribute }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net50); 15081var comp = CreateCompilation(new[] { code, InterpolatedStringHandlerAttribute }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net50); 15158var comp = CreateCompilation(new[] { code, InterpolatedStringHandlerAttribute }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net50); 15255var comp = CreateCompilation(new[] { code, InterpolatedStringHandlerAttribute }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net50); 18255CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 18274CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\LambdaTests.cs (2)
7158var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 8270CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(
Semantics\LocalFunctionTests.cs (1)
4012CreateCompilation(source, options: option, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(
Semantics\NameOfTests.cs (5)
520", parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)); 594parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)); 618parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 637parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics( 659parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\NullableReferenceTypesTests.cs (5)
1243var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 1285var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll); 81300parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp8)); 81371var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { source }, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp8)); 155379var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA));
Semantics\RawInterpolationTests.cs (2)
1300CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 1319CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\RecordStructTests.cs (1)
7979var comp = CreateCompilationWithMscorlibAndSpan(new[] { text, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
Semantics\RefEscapingTests.cs (101)
140}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 189}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 235var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 285CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 566CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 612CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 670CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 711CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 759CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 835var comp = CreateCompilationWithMscorlibAndSpan(text, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1005var comp = CreateCompilationWithMscorlibAndSpan(text, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1124var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1188var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1241var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1292var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1360var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1450var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1491var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1525var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1587var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1650var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1863var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1927var comp = CreateCompilationWithMscorlibAndSpan(new[] { text, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1992CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 2038CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 2087CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 2398CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 2795""", options: TestOptions.Regular.WithLanguageVersion(languageVersion)); 2916""", options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 2946""", TestOptions.Regular.WithLanguageVersion(languageVersion)); 3039""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3194""", TestOptions.Regular.WithLanguageVersion(languageVersion)); 3276""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3363""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp13)); 3446""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3511CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 3579CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 3654CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 3737CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 3782""", TestOptions.Regular.WithLanguageVersion(languageVersion)); 3827""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3992""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 4182""", TestOptions.Regular.WithLanguageVersion(languageVersion)); 4339CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 4377CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 4551CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 4628var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4721var comp = CreateCompilationWithMscorlibAndSpan(text, options: TestOptions.UnsafeDebugDll, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4790CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 4844var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4902CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 4960CreateCompilationWithMscorlibAndSpan(new[] { text, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 4975CreateCompilationWithMscorlibAndSpan(new[] { text, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5022CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5052var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5076var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5100var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5150var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5200var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5252var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5279var comp = CreateCompilationWithMscorlibAndSpan(csharp, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll); 5346CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5385var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 5435CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5479CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5509CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5537CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeDebugDll).VerifyDiagnostics( 5567var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 5621var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.NetCoreApp); 5656var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.NetCoreApp); 5700CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 5755var compilation = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 5840var compilation = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 5955var compilation = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 6011CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 6042var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 6534CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6572var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 6609var comp = CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 6646CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 6676CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 6719CreateCompilationWithMscorlibAndSpan(text, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics(); 6745}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( 6771}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( 6858""", options: TestOptions.Regular.WithLanguageVersion(languageVersion)); 6903}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll); 7000}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics( 7027}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics( 7056}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics( 7084", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7105}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7135}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7162}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7191CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7218}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)).VerifyDiagnostics( 7244}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics(); 7262}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics(); 7280}", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics( 7342", parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseDll).VerifyDiagnostics(); 10274""", TestOptions.Regular.WithLanguageVersion(languageVersion)); 10361""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11));
Semantics\RefExtensionMethodsTests.cs (6)
2292CreateCompilationWithMscorlib40AndSystemCore(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 2327parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2335parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2372CreateCompilationWithMscorlib40AndSystemCore(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 2431parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2439parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1),
Semantics\RefFieldTests.cs (83)
2289var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net70); 4934var comp = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4961var comp = CreateCompilationWithMscorlib461(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 5072var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9143var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9166var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9189var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9221var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9265var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9311var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9345var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9366var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9415var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9469var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9521var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9569var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9621var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9660var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9746var comp = CreateCompilation(new[] { source, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 9794var comp = CreateCompilation(new[] { source, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 10134var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 10175comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 10319parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10363parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10417parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), 10470var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 10619var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 10633comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 10650var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 10664comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 10684var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 10701comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 10743var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 10760comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 10799var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA), options: TestOptions.UnsafeReleaseDll); 10812comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB), options: TestOptions.UnsafeReleaseDll); 10841var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 10854comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 11546var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 11644var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 11669var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 11711var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 11739var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp10)); 11785var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 11905var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 13329var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 13353var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 13377var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 13399var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 14675var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 14965var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 15072var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(langVersion)); 16911var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 20009var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 20068var comp = CreateCompilationWithSpanAndMemoryExtensions(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: TargetFramework.Net50); 20229var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 20251var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25216var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25253var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 25259comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25289var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25337var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA), options: TestOptions.UnsafeReleaseDll); 25343comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25379var comp = CreateCompilation(new[] { source, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 25446var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 25459comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25497var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 25518comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25603comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25624var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 25645comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25779comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 25832var comp = CreateCompilation(sourceA, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionA)); 25974comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 26020comp = CreateCompilation(sourceB, new[] { refA }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersionB)); 27095var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), targetFramework: targetFramework); 27162comp = CreateEmptyCompilation(source1, references: new[] { ref0 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 27171comp = CreateEmptyCompilation(source2, references: new[] { ref0, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 27223comp = CreateEmptyCompilation(source1, references: new[] { refLowerVersion }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 27238comp = CreateEmptyCompilation(source2, references: new[] { refHigherVersion, ref1 }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 30326var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 30382var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.UnsafeReleaseDll); 30652var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
Semantics\RefLocalsAndReturnsTests.cs (6)
266}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 284}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 552}", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 585var comp = CreateCompilationWithMscorlibAndSpan(new[] { source, UnscopedRefAttributeDefinition }, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4965var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.RegularDefault.WithLanguageVersion(langVersion)); 5018var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.RegularDefault.WithLanguageVersion(langVersion));
Semantics\ScriptSemanticsTests.cs (1)
485var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6));
Semantics\SemanticErrorTests.cs (2)
24132CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 24555parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\SpanStackSafetyTests.cs (3)
2202var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseExe); 2238var comp = CreateCompilationWithMscorlibAndSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion), options: TestOptions.ReleaseExe); 2372}", parseOptions: TestOptions.RegularDefault.WithLanguageVersion(languageVersion));
Semantics\StackAllocInitializerTests.cs (1)
1461var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Semantics\StackAllocSpanExpressionsTests.cs (2)
363var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7); 382var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Semantics\StructConstructorTests.cs (5)
850TestOptions.Regular.WithLanguageVersion(languageVersion.Value); 3770var comp = CreateCompilationWithSpan(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4171var verifier = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4739var verifier = CompileAndVerify(new[] { source }, options: WithNullableEnable(), parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 4771var verifier = CompileAndVerify(new[] { source }, options: WithNullableEnable(), parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion));
Semantics\SwitchTests.cs (2)
2821CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp2)).VerifyDiagnostics(); 2822CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp1)).VerifyDiagnostics(
Semantics\TargetTypedConditionalOperatorTests.cs (6)
490CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3), expectedOutput: expectedOutput); 525CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3)).VerifyDiagnostics(expectedDiagnostics); 556CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3), expectedOutput: expectedOutput); 587CompileAndVerify(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3), expectedOutput: expectedOutput); 613CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics(); 639CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
SourceGeneration\GeneratorDriverTests.cs (4)
482var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 3580parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp2); 3596parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp8); 4492var newParseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp9);
SourceGeneration\StateTableTests.cs (1)
1344var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10);
SourceGeneration\SyntaxAwareGeneratorTests.cs (3)
1849var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 1890var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 1931var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (32)
Compilation\CompilationAPITests.cs (10)
682syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree("public class C {}", options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 692options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 703options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 716options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 2069class C { }", options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp10)); 2077class C { }", options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp10)); 2081class C { }", options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp10)); 2379var tree1 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2380var tree2 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2381var tree3 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
Compilation\UsedAssembliesTests.cs (1)
191var parseOptions = ((CSharpParseOptions)tree.Options).WithLanguageVersion(treeLanguageVersion > LanguageVersion.CSharp10 ? treeLanguageVersion : LanguageVersion.CSharp10);
DocumentationComments\CrefTests.cs (4)
4417var tree1 = Parse(source1, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.Diagnose).WithLanguageVersion(LanguageVersion.Latest)); 4418var tree2 = Parse(source2, options: TestOptions.Regular.WithDocumentationMode(DocumentationMode.None).WithLanguageVersion(LanguageVersion.Latest)); 6993var comp = CreateCompilation(source, parseOptions: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp10), targetFramework: TargetFramework.NetCoreApp); 7038var comp = CreateCompilation(source, parseOptions: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp10), targetFramework: TargetFramework.NetCoreApp);
SymbolDisplay\SymbolDisplayTests.cs (2)
8215TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8236TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp9),
Symbols\ExtensionMethodTests.cs (1)
2423var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6));
Symbols\RequiredMembersTests.cs (2)
6971""", new[] { reference }, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview)); 6990""", new[] { reference }, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview));
Symbols\Source\FieldTests.cs (1)
341CreateCompilationWithMscorlib46(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics(
Symbols\Source\FileModifierTests.cs (1)
4089var comp = CreateSubmission(source1, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview));
Symbols\Source\ModifierTests.cs (2)
273CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 307CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics(
Symbols\Source\PropertyTests.cs (2)
2854CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp3)).VerifyDiagnostics(); 2855CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp2)).VerifyDiagnostics(
Symbols\Source\UsingAliasTests.cs (1)
731var compilation = CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Symbols\SymbolErrorTests.cs (5)
1169CreateCompilationWithMscorlib46(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics( 2114var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 2541var comp = CreateCompilation(Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 10944var comp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)); 17945Parse(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (526)
IncrementalParsing\ChangingAsync.cs (2)
61ParseAndValidate(text, validator, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)); 62ParseAndValidate(text, validator, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp5));
Parsing\AsyncParsingTests.cs (2)
21return SyntaxFactory.ParseSyntaxTree(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5)); 26return SyntaxFactory.ParseExpression(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5));
Parsing\AsyncStreamsParsingTests.cs (2)
22return SyntaxFactory.ParseSyntaxTree(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp8)); 27return SyntaxFactory.ParseExpression(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp8));
Parsing\CollectionExpressionParsingTests.cs (1)
22UsingExpression("[A, B]", TestOptions.Regular.WithLanguageVersion(languageVersion));
Parsing\CrefParsingTests.cs (6)
1469UsingNode("A(readonly ref B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose), 1496UsingNode("A(readonly B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose), 1523UsingNode("A(in readonly B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose), 1558UsingNode("A(out readonly B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose), 1593UsingNode("A(ref readonly readonly B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose), 1632UsingNode("A(readonly ref B)", TestOptions.Regular.WithLanguageVersion(languageVersion).WithDocumentationMode(DocumentationMode.Diagnose),
Parsing\CSharpParseOptionsTests.cs (2)
45TestProperty((old, value) => old.WithLanguageVersion(value), opt => opt.LanguageVersion, LanguageVersion.CSharp3); 215var options = new CSharpParseOptions().WithLanguageVersion(unchecked((LanguageVersion)10000));
Parsing\DeclarationParsingTests.cs (3)
585var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); 651var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); 696var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Parsing\DeclarationScopeParsingTests.cs (224)
24UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 71UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 142UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion), 314UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 431UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 598UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion), 683UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 746UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion), 800UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 840UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(langVersion), 895UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 937UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1003UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1037UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1067UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1097UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1198UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1266UsingExpression(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1409UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1543UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1614UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1730UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1856UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 1921UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 1971UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2016UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 2091UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2148UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2172UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2198UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2304UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2410UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2502UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2550UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 2620UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2685UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 2728UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 2773UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 2848UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 3024UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 3171UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 3259var parseOptions = TestOptions.Regular.WithLanguageVersion(langVersion); 3488UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 3555UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 3626UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 3702UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 3778UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 3850UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 3937UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 4017UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4088UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 4157UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4232UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 4305UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4381UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 4455UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4526UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4601UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4677UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4752UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4823UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4894UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 4969UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5045UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5112UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5183UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5256UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5329UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5413UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5482UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5552UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5631UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5702UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5781UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 5902UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 5954UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6010UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6088UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6156UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6213UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6303UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6386UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6442UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6513UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6573UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6645UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6706UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 6797UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6853UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6913UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 6974UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7034UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7090UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7146UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7206UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7267UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7319UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7375UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7453UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7521UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7593UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7663UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7734UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7806UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7873UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 7941UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 7997UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8050UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8089UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8157UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8191UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8254UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8321UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8358UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8395UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8436UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8484UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8529UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8571UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8620UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8668UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8709UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8759UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8804UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8861UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 8907UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 8978UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9019UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9064UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9110UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9155UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9196UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9245UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9286UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9332UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9378UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9415UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9456UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9497UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9539UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9587UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9661UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9695UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9733UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9796UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 9835UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9912UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 9982UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10020UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10076UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10118UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10181UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10224UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10294UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10332UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10374UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10417UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10459UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10497UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10535UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10577UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10620UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10654UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 10692UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10746UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10804UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10874UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 10962UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11016UsingStatement(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11117UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11358UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11390UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11478UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11515UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11610UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11685UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11740UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11799UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 11839UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11896UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 11985UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12026UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12082UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12126UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12172UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12214UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12260UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12319UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12386UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12433UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12503UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12566UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12612UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12664UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12714UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12770UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12821UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 12878UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12924UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 12974UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13025UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13075UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13121UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13175UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13221UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13271UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13322UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13364UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13410UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13469UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13539UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 13591UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13661UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13735UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13845UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 13962UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14021UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14085UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14153UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14227UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion)); 14275UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14361UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14417UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion), 14485UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion),
Parsing\ExpressionParsingTests.cs (7)
211}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 241}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)).VerifyDiagnostics(); 267}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 316}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)).VerifyDiagnostics(); 731var expr = this.ParseExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 764var expr = this.ParseExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 4761var expr = this.ParseExpression(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1));
Parsing\FieldKeywordParsingTests.cs (38)
63TestOptions.Regular.WithLanguageVersion(languageVersion)); 123TestOptions.Regular.WithLanguageVersion(languageVersion)); 165TestOptions.Regular.WithLanguageVersion(languageVersion)); 216TestOptions.Regular.WithLanguageVersion(languageVersion)); 273TestOptions.Regular.WithLanguageVersion(languageVersion)); 335TestOptions.Regular.WithLanguageVersion(languageVersion)); 392TestOptions.Regular.WithLanguageVersion(languageVersion)); 458TestOptions.Regular.WithLanguageVersion(languageVersion)); 530TestOptions.Regular.WithLanguageVersion(languageVersion)); 609TestOptions.Regular.WithLanguageVersion(languageVersion)); 677TestOptions.Regular.WithLanguageVersion(languageVersion)); 757TestOptions.Regular.WithLanguageVersion(languageVersion)); 853TestOptions.Regular.WithLanguageVersion(languageVersion)); 903TestOptions.Regular.WithLanguageVersion(languageVersion)); 960TestOptions.Regular.WithLanguageVersion(languageVersion)); 1006TestOptions.Regular.WithLanguageVersion(languageVersion)); 1052TestOptions.Regular.WithLanguageVersion(languageVersion)); 1098TestOptions.Regular.WithLanguageVersion(languageVersion)); 1148TestOptions.Regular.WithLanguageVersion(languageVersion)); 1202TestOptions.Regular.WithLanguageVersion(languageVersion)); 1249TestOptions.Regular.WithLanguageVersion(languageVersion)); 1318TestOptions.Regular.WithLanguageVersion(languageVersion)); 1369TestOptions.Regular.WithLanguageVersion(languageVersion)); 1423TestOptions.Regular.WithLanguageVersion(languageVersion)); 1484TestOptions.Regular.WithLanguageVersion(languageVersion)); 1562TestOptions.Regular.WithLanguageVersion(languageVersion)); 1626TestOptions.Regular.WithLanguageVersion(languageVersion)); 1702TestOptions.Regular.WithLanguageVersion(languageVersion)); 1753TestOptions.Regular.WithLanguageVersion(languageVersion)); 1843TestOptions.Regular.WithLanguageVersion(languageVersion)); 1920TestOptions.Regular.WithLanguageVersion(languageVersion)); 1971TestOptions.Regular.WithLanguageVersion(languageVersion)); 2030TestOptions.Regular.WithLanguageVersion(languageVersion)); 2089TestOptions.Regular.WithLanguageVersion(languageVersion)); 2153TestOptions.Regular.WithLanguageVersion(languageVersion)); 2226TestOptions.Regular.WithLanguageVersion(languageVersion)); 2279TestOptions.Regular.WithLanguageVersion(languageVersion)); 2334TestOptions.Regular.WithLanguageVersion(languageVersion));
Parsing\FileModifierParsingTests.cs (4)
1526options: TestOptions.Regular.WithLanguageVersion(languageVersion)); 3145options: TestOptions.Regular.WithLanguageVersion(languageVersion), 3189options: TestOptions.Regular.WithLanguageVersion(languageVersion), 3230options: TestOptions.Regular.WithLanguageVersion(languageVersion),
Parsing\LambdaParameterParsingTests.cs (3)
5153UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 5183UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 5211UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion),
Parsing\LocalFunctionParsingTests.cs (1)
1287var file = ParseFile(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
Parsing\MemberDeclarationParsingTests.cs (83)
29public static readonly IEnumerable<object[]> Regular10AndScriptAndRequiredMembersMinimum = new[] { new[] { TestOptions.Regular10 }, new[] { RequiredMembersOptions }, new[] { TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp10) } }; 30public static readonly IEnumerable<object[]> Regular10AndScript = new[] { new[] { TestOptions.Regular10 }, new[] { TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp10) } }; 2351UsingDeclaration(text, options: options.WithLanguageVersion(version)); 2493UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 2617UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 2723UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 2829UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 2881UsingDeclaration("public int N::I::operator +(int x, int y) => x + y;", options: options.WithLanguageVersion(LanguageVersion.Preview), 2961UsingDeclaration("public int I::operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 3016UsingDeclaration("public int I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 3067UsingDeclaration("public int I<T>.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 3127UsingDeclaration("public int N1::N2::I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 3232UsingTree(text, options: options.WithLanguageVersion(version)); 3377UsingTree(text, options: options.WithLanguageVersion(version), errors); 3505UsingTree(text, options: options.WithLanguageVersion(version), errors); 3615UsingTree(text, options: options.WithLanguageVersion(version), errors); 3725UsingTree(text, options: options.WithLanguageVersion(version), errors); 3781UsingTree("public int N::I::operator +(int x, int y) => x + y;", options: options.WithLanguageVersion(LanguageVersion.Preview), 3865UsingTree("public int I::operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 3924UsingTree("public int I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 3979UsingTree("public int I<T>.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 4043UsingTree("public int N1::N2::I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 4118UsingDeclaration("public int I..operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 4180UsingDeclaration("public int I . . operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 4271UsingDeclaration(text, options: options.WithLanguageVersion(version)); 4405UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 4522UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 4621UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 4720UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 4771UsingDeclaration("int N::I::operator +(int x, int y) => x + y;", options: options.WithLanguageVersion(LanguageVersion.Preview), 4850UsingDeclaration("int I::operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 4904UsingDeclaration("int I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 4954UsingDeclaration("int I<T>.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 5013UsingDeclaration("int N1::N2::I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 5111UsingTree(text, options: options.WithLanguageVersion(version)); 5249UsingTree(text, options: options.WithLanguageVersion(version), errors); 5370UsingTree(text, options: options.WithLanguageVersion(version), errors); 5473UsingTree(text, options: options.WithLanguageVersion(version), errors); 5576UsingTree(text, options: options.WithLanguageVersion(version), errors); 5631UsingTree("int N::I::operator +(int x, int y) => x + y;", options: options.WithLanguageVersion(LanguageVersion.Preview), 5714UsingTree("int I::operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 5772UsingTree("int I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 5826UsingTree("int I<T>.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 5889UsingTree("int N1::N2::I.operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 5963UsingDeclaration("int I..operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 6024UsingDeclaration("int I . . operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 6086UsingDeclaration("int N.I..operator +(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 6163UsingDeclaration("N.I.operator +(int x) => x;", options: options.WithLanguageVersion(version), errors); 6233UsingDeclaration("N.I. int(int x) => x;", options: options.WithLanguageVersion(version), errors); 6296UsingDeclaration(text, options: options.WithLanguageVersion(version)); 6396UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 6463UsingDeclaration("operator int(int x) => x;", options: options.WithLanguageVersion(version), errors); 6547UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 6647UsingDeclaration(text, options: options.WithLanguageVersion(version), errors); 6698UsingDeclaration("implicit N::I::operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 6760UsingDeclaration("explicit I::operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 6814UsingDeclaration("implicit I.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 6864UsingDeclaration("explicit I<T>.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 6923UsingDeclaration("implicit N1::N2::I.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7021UsingTree(text, options: options.WithLanguageVersion(version)); 7134UsingTree(text, options: options.WithLanguageVersion(version), errors); 7238UsingTree(text, options: options.WithLanguageVersion(version), errors); 7342UsingTree(text, options: options.WithLanguageVersion(version), errors); 7446UsingTree(text, options: options.WithLanguageVersion(version), errors); 7501UsingTree("implicit N::I::operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7567UsingTree("explicit I::operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7625UsingTree("implicit I.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 7679UsingTree("explicit I<T>.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview)); 7742UsingTree("implicit N1::N2::I.operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7816UsingDeclaration("explicit I..operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7877UsingDeclaration("implicit I . . operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7939UsingDeclaration("explicit I T(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 7996UsingDeclaration("explicit I.T(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 8050UsingDeclaration("explicit I.operator (int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 8104UsingDeclaration("explicit I.operator (int x) { return x; }", options: options.WithLanguageVersion(LanguageVersion.Preview), 8163UsingDeclaration("explicit I.operator (int x);", options: options.WithLanguageVersion(LanguageVersion.Preview), 8209UsingDeclaration("explicit I.T1 T2(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview), 8274UsingDeclaration("explicit I.operator (int x)", options: options.WithLanguageVersion(LanguageVersion.Preview), 8323UsingDeclaration("explicit I.operator (int x, );", options: options.WithLanguageVersion(LanguageVersion.Preview), 8384UsingDeclaration("explicit I.operator (int x, int y);", options: options.WithLanguageVersion(LanguageVersion.Preview), 8443UsingDeclaration("explicit I.operator var(x);", options: options.WithLanguageVersion(LanguageVersion.Preview), 8489UsingDeclaration("explicit I.operator (int x int y);", options: options.WithLanguageVersion(LanguageVersion.Preview), 8547UsingDeclaration("explicit N.I..operator int(int x) => x;", options: options.WithLanguageVersion(LanguageVersion.Preview),
Parsing\ParserErrorMessageTests.cs (57)
2739ParseAndValidate(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6), 2768CreateCompilationWithMscorlib46(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics( 2791CreateCompilationWithMscorlib46(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7)).VerifyDiagnostics( 2902ParseAndValidate(test, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6), 4626ParseAndValidate(test, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6), 5439var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5442tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)); 5461var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5464tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5526var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5529tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5545var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5548tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5588var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5591tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5623var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5626tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5657var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5660tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5694var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 5697tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5927CreateCompilation(test, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).VerifyDiagnostics( 5946var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5964var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5977var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5985tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6006var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6013tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6036var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6049tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6078var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6091tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6148SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6149SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6160SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6161SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6184SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6185SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6215SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6216SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6243SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6244SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6271SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6272SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6285SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6286SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6304SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6305SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6328SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6329SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6348SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6349SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6365var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6380SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6381SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6475SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)).GetDiagnostics().Verify(); 6477SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).GetDiagnostics().Verify();
Parsing\ParsingErrorRecoveryTests.cs (2)
6228var file = this.ParseTree(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)); 6339var file = this.ParseTree(text, options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
Parsing\PatternParsingTests.cs (3)
22UsingStatement(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8), expectedErrors); 50CreateCompilation(test, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics( 6580UsingStatement(text, options: CSharpParseOptions.Default.WithLanguageVersion(langVersion));
Parsing\PatternParsingTests_ListPatterns.cs (1)
19UsingExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview), expectedErrors);
Parsing\PatternParsingTests2.cs (1)
18UsingExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview), expectedErrors);
Parsing\ReadOnlyStructs.cs (6)
40var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll); 77var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), options: TestOptions.DebugDll); 105var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll); 149var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll.WithAllowUnsafe(true)); 182var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll); 216var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll);
Parsing\RefFieldParsingTests.cs (23)
24UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 61UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 99UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 135UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 172UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 230UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 292UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 352UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 405UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 467UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 550UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 653UsingDeclaration(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 699UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 739UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 783UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 848UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 880UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion)); 931UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 985UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 1016UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 1055UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 1094UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion), 1141UsingExpression(source, TestOptions.Regular.WithLanguageVersion(languageVersion),
Parsing\RefReadonlyTests.cs (5)
45var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), options: TestOptions.UnsafeDebugDll); 90var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7_1), options: TestOptions.UnsafeDebugDll); 1319UsingExpression("M(ref x, in y, ref readonly z)", TestOptions.Regular.WithLanguageVersion(languageVersion), 1383UsingExpression("M(readonly ref x)", TestOptions.Regular.WithLanguageVersion(languageVersion), 1415UsingExpression("M(readonly x)", TestOptions.Regular.WithLanguageVersion(languageVersion),
Parsing\RefStructs.cs (3)
38var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll); 54var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp7), options: TestOptions.DebugDll); 81var comp = CreateCompilationWithMscorlib461(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.Latest), options: TestOptions.DebugDll);
Parsing\RoundTrippingTests.cs (1)
23ParseAndRoundTripping(text, TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.Preview), errorCount, memberCount);
Parsing\SeparatedSyntaxListParsingTests.cs (1)
735var tree = UsingTree(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6),
Parsing\TopLevelStatementsParsingTests.cs (1)
1621var tree = UsingTree(test, TestOptions.RegularPreview.WithLanguageVersion(version));
Syntax\FieldAndValueKeywordTests.cs (44)
40var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 107var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 132var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 170var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 198var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 216var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 234var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 253var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 281var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 308var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 325var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 352var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 379var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 406var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 433var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 460var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 477var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 494var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 511var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 527var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 543var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 567var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 584var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 601var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 636var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 661var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 700var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 738var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 774var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 810var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 846var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 926var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 960var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 989var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1016var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1062var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1110var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1175var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1218comp = CreateCompilation(sourceB1, references: [refA], parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1238comp = CreateCompilation(sourceB2, references: [refA], parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1248comp = CreateCompilation(sourceB3, references: [refA], parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1258comp = CreateCompilation(sourceB4, references: [refA], parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1269comp = CreateCompilation(sourceB5, references: [refA], parseOptions: TestOptions.Regular.WithLanguageVersion(languageVersion)); 1306var parseOptions = TestOptions.Regular.WithLanguageVersion(languageVersion);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (20)
TestOptions.cs (20)
21public static readonly CSharpParseOptions Regular1 = Regular.WithLanguageVersion(LanguageVersion.CSharp1); 22public static readonly CSharpParseOptions Regular2 = Regular.WithLanguageVersion(LanguageVersion.CSharp2); 23public static readonly CSharpParseOptions Regular3 = Regular.WithLanguageVersion(LanguageVersion.CSharp3); 24public static readonly CSharpParseOptions Regular4 = Regular.WithLanguageVersion(LanguageVersion.CSharp4); 25public static readonly CSharpParseOptions Regular5 = Regular.WithLanguageVersion(LanguageVersion.CSharp5); 26public static readonly CSharpParseOptions Regular6 = Regular.WithLanguageVersion(LanguageVersion.CSharp6); 27public static readonly CSharpParseOptions Regular7 = Regular.WithLanguageVersion(LanguageVersion.CSharp7); 28public static readonly CSharpParseOptions Regular7_1 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_1); 29public static readonly CSharpParseOptions Regular7_2 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_2); 30public static readonly CSharpParseOptions Regular7_3 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_3); 31public static readonly CSharpParseOptions RegularDefault = Regular.WithLanguageVersion(LanguageVersion.Default); 37public static readonly CSharpParseOptions RegularNext = Regular.WithLanguageVersion(LanguageVersion.Preview); 39public static readonly CSharpParseOptions RegularPreview = Regular.WithLanguageVersion(LanguageVersion.Preview); 40public static readonly CSharpParseOptions Regular8 = Regular.WithLanguageVersion(LanguageVersion.CSharp8); 41public static readonly CSharpParseOptions Regular9 = Regular.WithLanguageVersion(LanguageVersion.CSharp9); 42public static readonly CSharpParseOptions Regular10 = Regular.WithLanguageVersion(LanguageVersion.CSharp10); 43public static readonly CSharpParseOptions Regular11 = Regular.WithLanguageVersion(LanguageVersion.CSharp11); 44public static readonly CSharpParseOptions Regular12 = Regular.WithLanguageVersion(LanguageVersion.CSharp12); 45public static readonly CSharpParseOptions Regular13 = Regular.WithLanguageVersion(LanguageVersion.CSharp13); 51public static readonly CSharpParseOptions WithoutCovariantReturns = Regular.WithLanguageVersion(LanguageVersion.CSharp8);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (1)
21private static readonly CSharpParseOptions _parseOptionWithLatestLanguageVersion = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4000.AddSyntaxTrees(ParseSyntaxTree(src, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Simplification\CastSimplificationTests.vb (2)
515Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)) 546Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10))
Microsoft.CodeAnalysis.Rebuild (1)
CSharpCompilationFactory.cs (1)
77var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(langVersion)
Microsoft.CodeAnalysis.Rebuild.UnitTests (2)
CSharpDeterministicKeyBuilderTests.cs (2)
326var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(languageVersion); 427syntaxTrees: new[] { CSharpSyntaxTree.ParseText(@"// this is a comment", CSharpParseOptions.Default.WithLanguageVersion(CSharp.LanguageVersion.CSharp10)) },
Microsoft.CodeAnalysis.Test.Utilities (1)
CommonTestBase.cs (1)
363parseOptions = CSharp.CSharpParseOptions.Default.WithLanguageVersion(CSharp.LanguageVersion.Default).WithDocumentationMode(DocumentationMode.None);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
313return ((CSharpParseOptions)parseOptions).WithLanguageVersion(languageVersion);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
WorkspaceTests\AdhocWorkspaceTests.cs (1)
387pws.SetParseOptions(projid, parseOptions.WithLanguageVersion(CS.LanguageVersion.CSharp3));
Microsoft.ML.CodeAnalyzer.Tests (2)
Code\BestFriendTest.cs (1)
69projectA = projectA.WithParseOptions(((CSharpParseOptions)projectA.ParseOptions).WithLanguageVersion(LanguageVersion.CSharp7_2));
Helpers\CSharpCodeFixVerifier`2.cs (1)
73solution = solution.WithProjectParseOptions(projectId, parseOptions.WithLanguageVersion(LanguageVersion.Value));
Microsoft.VisualStudio.LanguageServices.CSharp (3)
LanguageService\CSharpEditorFactory.cs (1)
38return project.WithParseOptions(parseOptions.WithLanguageVersion(langVersion));
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
230.WithLanguageVersion(languageVersion)
Utilities\CSharpParseOptionsChangingService.cs (1)
31if (oldCSharpOptions.WithLanguageVersion(newCSharpOptions.SpecifiedLanguageVersion) != newOptions)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (4)
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (2)
64oldParseOptions.WithLanguageVersion(attemptedVersion), 89oldParseOptions.WithLanguageVersion(attemptedVersion),
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (2)
197oldParseOptions.WithLanguageVersion(attemptedVersion), 228oldParseOptions.WithLanguageVersion(attemptedVersion),
System.Windows.Forms.Analyzers.CSharp.Tests (1)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (1)
39return parseOptions.WithLanguageVersion(LanguageVersion.Preview);