6974 references to LanguageVersion
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.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CSharpCompiler.cs (2)
221parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp8); 223else if (LanguageVersionFacts.TryParse(dependencyContextOptions.LanguageVersion, out var languageVersion))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
CSharpCompilerTest.cs (2)
125Assert.Equal(LanguageVersion.CSharp8, parseOptions.LanguageVersion); 154Assert.Equal(LanguageVersion.CSharp7_1, compilationOptions.LanguageVersion);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TargetTests.cs (1)
440Assert.Equal(CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersionFacts.CurrentVersion);
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (6)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (3)
60/// <see cref="LanguageVersion.CSharp8"/>. 62public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.CSharp8;
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (3)
59/// <see cref="LanguageVersion.CSharp8"/>. 61public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.CSharp8;
Microsoft.CodeAnalysis.CSharp (176)
Binder\Binder_Expressions.cs (2)
4528LanguageVersion requiredVersion = MessageID.IDS_FeatureNestedStackalloc.RequiredVersion(); 10618if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
Binder\Binder_Patterns.cs (2)
630var requiredVersion = MessageID.IDS_FeatureRecursivePatterns.RequiredVersion(); 773LanguageVersion requiredVersion = MessageID.IDS_FeatureGenericPatternMatching.RequiredVersion();
Binder\Binder_Symbols.cs (2)
611internal static CSDiagnosticInfo? GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(LanguageVersion languageVersion, in TypeWithAnnotations type) 617var requiredVersion = MessageID.IDS_FeatureDefaultTypeParameterConstraint.RequiredVersion();
Binder\Semantics\OverloadResolution\OverloadResolution.cs (2)
1304(binder.Compilation.LanguageVersion > LanguageVersion.CSharp12 || member.ContainingModule == binder.Compilation.SourceModule))) 3017if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
CommandLine\CSharpCommandLineParser.cs (2)
88LanguageVersion languageVersion = LanguageVersion.Default;
CommandLine\CSharpCompiler.cs (7)
285var defaultVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion(); 286var latestVersion = LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(); 287foreach (var v in (LanguageVersion[])Enum.GetValues(typeof(LanguageVersion)))
Compilation\CSharpCompilation.cs (6)
227internal bool IsPeVerifyCompatEnabled => LanguageVersion < LanguageVersion.CSharp7_2 || Feature("peverify-compat") != null; 318public LanguageVersion LanguageVersion 534private static LanguageVersion CommonLanguageVersion(ImmutableArray<SyntaxTree> syntaxTrees) 536LanguageVersion? result = null; 539var version = ((CSharpParseOptions)tree.Options).LanguageVersion; 550return result ?? LanguageVersion.Default.MapSpecifiedToEffectiveVersion();
CSharpParseOptions.cs (9)
31public LanguageVersion LanguageVersion { get; private set; } 38public LanguageVersion SpecifiedLanguageVersion { get; private set; } 51LanguageVersion languageVersion = LanguageVersion.Default, 64LanguageVersion languageVersion, 99public CSharpParseOptions WithLanguageVersion(LanguageVersion version) 106var effectiveLanguageVersion = version.MapSpecifiedToEffectiveVersion(); 266LanguageVersion availableVersion = LanguageVersion; 267LanguageVersion requiredVersion = feature.RequiredVersion();
Errors\LazyUseSiteDiagnosticsInfoForNullableType.cs (2)
11private readonly LanguageVersion _languageVersion; 14internal LazyUseSiteDiagnosticsInfoForNullableType(LanguageVersion languageVersion, TypeWithAnnotations possiblyNullableTypeSymbol)
Errors\MessageID.cs (21)
453private static CSDiagnosticInfo GetDisabledFeatureDiagnosticInfo(MessageID feature, LanguageVersion availableVersion) 461LanguageVersion requiredVersion = feature.RequiredVersion(); 462return requiredVersion == LanguageVersion.Preview.MapSpecifiedToEffectiveVersion() 467internal static LanguageVersion RequiredVersion(this MessageID feature) 481return LanguageVersion.Preview; 493return LanguageVersion.CSharp13; 504return LanguageVersion.CSharp12; 522return LanguageVersion.CSharp11; 543return LanguageVersion.CSharp10; 571return LanguageVersion.CSharp9; 596return LanguageVersion.CSharp8; 612return LanguageVersion.CSharp7_3; 623return LanguageVersion.CSharp7_2; 630return LanguageVersion.CSharp7_1; 644return LanguageVersion.CSharp7; 659return LanguageVersion.CSharp6; 663return LanguageVersion.CSharp5; 670return LanguageVersion.CSharp4; 683return LanguageVersion.CSharp3; 699return LanguageVersion.CSharp2; 703return LanguageVersion.CSharp1;
FlowAnalysis\NullableWalker.cs (1)
2425var requiredVersion = MessageID.IDS_FeatureDefaultTypeParameterConstraint.RequiredVersion();
LanguageVersion.cs (96)
274internal static bool IsValid(this LanguageVersion value) 278case LanguageVersion.CSharp1: 279case LanguageVersion.CSharp2: 280case LanguageVersion.CSharp3: 281case LanguageVersion.CSharp4: 282case LanguageVersion.CSharp5: 283case LanguageVersion.CSharp6: 284case LanguageVersion.CSharp7: 285case LanguageVersion.CSharp7_1: 286case LanguageVersion.CSharp7_2: 287case LanguageVersion.CSharp7_3: 288case LanguageVersion.CSharp8: 289case LanguageVersion.CSharp9: 290case LanguageVersion.CSharp10: 291case LanguageVersion.CSharp11: 292case LanguageVersion.CSharp12: 293case LanguageVersion.CSharp13: 294case LanguageVersion.Preview: 301internal static ErrorCode GetErrorCode(this LanguageVersion version) 305case LanguageVersion.CSharp1: 307case LanguageVersion.CSharp2: 309case LanguageVersion.CSharp3: 311case LanguageVersion.CSharp4: 313case LanguageVersion.CSharp5: 315case LanguageVersion.CSharp6: 317case LanguageVersion.CSharp7: 319case LanguageVersion.CSharp7_1: 321case LanguageVersion.CSharp7_2: 323case LanguageVersion.CSharp7_3: 325case LanguageVersion.CSharp8: 327case LanguageVersion.CSharp9: 329case LanguageVersion.CSharp10: 331case LanguageVersion.CSharp11: 333case LanguageVersion.CSharp12: 335case LanguageVersion.CSharp13: 345internal LanguageVersion Version { get; } 347internal CSharpRequiredLanguageVersion(LanguageVersion version) 368internal const LanguageVersion CSharpNext = LanguageVersion.Preview; 374public static string ToDisplayString(this LanguageVersion version) 378case LanguageVersion.CSharp1: 380case LanguageVersion.CSharp2: 382case LanguageVersion.CSharp3: 384case LanguageVersion.CSharp4: 386case LanguageVersion.CSharp5: 388case LanguageVersion.CSharp6: 390case LanguageVersion.CSharp7: 392case LanguageVersion.CSharp7_1: 394case LanguageVersion.CSharp7_2: 396case LanguageVersion.CSharp7_3: 398case LanguageVersion.CSharp8: 400case LanguageVersion.CSharp9: 402case LanguageVersion.CSharp10: 404case LanguageVersion.CSharp11: 406case LanguageVersion.CSharp12: 408case LanguageVersion.CSharp13: 410case LanguageVersion.Default: 412case LanguageVersion.Latest: 414case LanguageVersion.LatestMajor: 416case LanguageVersion.Preview: 424/// Try parse a <see cref="LanguageVersion"/> from a string input, returning default if input was null. 426public static bool TryParse(string? version, out LanguageVersion result) 430result = LanguageVersion.Default; 437result = LanguageVersion.Default; 441result = LanguageVersion.Latest; 445result = LanguageVersion.LatestMajor; 449result = LanguageVersion.Preview; 455result = LanguageVersion.CSharp1; 461result = LanguageVersion.CSharp2; 466result = LanguageVersion.CSharp3; 471result = LanguageVersion.CSharp4; 476result = LanguageVersion.CSharp5; 481result = LanguageVersion.CSharp6; 486result = LanguageVersion.CSharp7; 490result = LanguageVersion.CSharp7_1; 494result = LanguageVersion.CSharp7_2; 498result = LanguageVersion.CSharp7_3; 503result = LanguageVersion.CSharp8; 508result = LanguageVersion.CSharp9; 513result = LanguageVersion.CSharp10; 518result = LanguageVersion.CSharp11; 523result = LanguageVersion.CSharp12; 528result = LanguageVersion.CSharp13; 532result = LanguageVersion.Default; 540public static LanguageVersion MapSpecifiedToEffectiveVersion(this LanguageVersion version) 544case LanguageVersion.Latest: 545case LanguageVersion.Default: 546case LanguageVersion.LatestMajor: 547return LanguageVersion.CSharp13; 553internal static LanguageVersion CurrentVersion => LanguageVersion.CSharp13; 556internal static bool DisallowInferredTupleElementNames(this LanguageVersion self) 561internal static bool AllowNonTrailingNamedArguments(this LanguageVersion self) 566internal static bool AllowAttributesOnBackingFields(this LanguageVersion self) 571internal static bool AllowImprovedOverloadCandidates(this LanguageVersion self)
Parser\DirectiveParser.cs (4)
326var specified = this.Options.SpecifiedLanguageVersion; 327var effective = specified.MapSpecifiedToEffectiveVersion(); 337if (this.Options.LanguageVersion != LanguageVersion.Preview && 339LanguageVersionFacts.TryParse(errorText.Substring(versionMarker.Length), out var languageVersion))
Symbols\Source\ModifierUtils.cs (6)
153LanguageVersion availableVersion = ((CSharpParseOptions)errorLocation.SourceTree.Options).LanguageVersion; 154LanguageVersion requiredVersion; 194internal static void ReportUnsupportedModifiersForLanguageVersion(DeclarationModifiers modifiers, DeclarationModifiers unsupportedModifiers, Location errorLocation, BindingDiagnosticBag diagnostics, LanguageVersion availableVersion, LanguageVersion requiredVersion) 217LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion; 218LanguageVersion requiredVersion = MessageID.IDS_FeatureStaticAbstractMembersInInterfaces.RequiredVersion();
Symbols\Source\SourceMemberContainerSymbol.cs (2)
4474var languageVersion = ((CSharpParseOptions)this.GetFirstLocation().SourceTree!.Options).LanguageVersion; 4475var requiredVersion = MessageID.IDS_FeatureSealedToStringInRecord.RequiredVersion();
Symbols\Source\SourcePropertySymbol.cs (2)
452LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion; 453LanguageVersion requiredVersion = MessageID.IDS_FeaturePartialProperties.RequiredVersion();
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (2)
169LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion; 170LanguageVersion requiredVersion = MessageID.IDS_FeatureStaticAbstractMembersInInterfaces.RequiredVersion();
Symbols\Symbol_Attributes.cs (1)
697if (parseOptions.LanguageVersion == LanguageVersion.CSharp1)
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
166var languageVersion = this.DeclaringCompilation.LanguageVersion;
Symbols\TypeSymbol.cs (6)
1015LanguageVersion requiredVersion = MessageID.IDS_FeatureImplicitImplementationOfNonPublicMembers.RequiredVersion(); 1016LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion; 1639LanguageVersion requiredVersion = feature.RequiredVersion(); 1640LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion; 1740LanguageVersion requiredVersion = MessageID.IDS_FeatureStaticAbstractMembersInInterfaces.RequiredVersion(); 1741LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion;
Microsoft.CodeAnalysis.CSharp.CodeStyle (97)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (2)
48LanguageVersion version) 56if (version < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9 ||
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
36var analyzer = new Analyzer(supportsOrPatterns: semanticModel.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9);
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
35if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
29if (node.GetLanguageVersion() < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
68if (csOptions.LanguageVersion < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
52if (ifStatement.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
32if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (2)
14public static bool IsStaticLocalFunctionSupported(LanguageVersion languageVersion) 15=> languageVersion >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
38if (compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
34if (compilation.LanguageVersion() < LanguageVersion.CSharp7_2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
37if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
30=> tree.Options.LanguageVersion() >= LanguageVersion.CSharp7;
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (1)
45if (compilationContext.Compilation.LanguageVersion() < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
43=> compilation.LanguageVersion() >= LanguageVersion.CSharp6; 46=> compilation.LanguageVersion() >= LanguageVersion.CSharp6; 49=> compilation.LanguageVersion() >= LanguageVersion.Preview;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (1)
44=> compilation.LanguageVersion() >= LanguageVersion.CSharp3;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
27options.LanguageVersion() >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
46if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (4)
142var languageVersion = body.SyntaxTree.Options.LanguageVersion(); 191var languageVersion = declaration.GetLanguageVersion(); 192if (languageVersion < LanguageVersion.CSharp7) 213if (languageVersion < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (4)
55var languageVersion = declaration.SyntaxTree.Options.LanguageVersion(); 57languageVersion < LanguageVersion.CSharp7) 67ExpressionBodyPreference preference, LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken) 109LanguageVersion languageVersion,
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
44if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
64if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
57if (compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.cs (2)
22=> compilation.LanguageVersion() >= LanguageVersion.CSharp7; 25=> compilation.LanguageVersion() >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
36if (compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
61if (compilation.LanguageVersion() < LanguageVersion.CSharp7) 128if (options.LanguageVersion() < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
47if (context.Compilation.LanguageVersion() >= LanguageVersion.CSharp11)
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
33=> compilation.LanguageVersion() >= LanguageVersion.CSharp6;
src\Analyzers\CSharp\Analyzers\UseObjectInitializer\CSharpUseObjectInitializerDiagnosticAnalyzer.cs (1)
36return compilation.LanguageVersion() >= LanguageVersion.CSharp3;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
60if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (2)
46if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8) 67asExpression, out var conditionalAccessExpression, out var binaryExpression, out var isPatternExpression, out var requiredLanguageVersion))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
61if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
52if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
42if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\UsePatternMatchingHelpers.cs (5)
19out LanguageVersion requiredLanguageVersion) 24requiredLanguageVersion = LanguageVersion.CSharp8; 46requiredLanguageVersion = LanguageVersion.CSharp10; 78requiredLanguageVersion = (LanguageVersion)Math.Max((int)requiredLanguageVersion, (int)LanguageVersion.CSharp9);
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
70if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
25=> compilation.LanguageVersion() >= LanguageVersion.CSharp7;
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
53if (compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (6)
22LanguageVersion languageVersion, 116LanguageVersion languageVersion, 125languageVersion >= LanguageVersion.CSharp7 || 126(languageVersion >= LanguageVersion.CSharp6 && IsSupportedInCSharp6(declarationKind)); 181private static bool TryGetExpression(StatementSyntax firstStatement, LanguageVersion languageVersion, [NotNullWhen(true)] out ExpressionSyntax? expression, out SyntaxToken semicolonToken) 204if (languageVersion >= LanguageVersion.CSharp7 && throwStatement.Expression != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
25if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1 ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\LanguageVersionExtensions.cs (14)
9public static bool IsCSharp14OrAbove(this LanguageVersion languageVersion) 10=> languageVersion >= LanguageVersion.Preview; 12public static bool IsCSharp13OrAbove(this LanguageVersion languageVersion) 13=> languageVersion >= LanguageVersion.CSharp13; 15public static bool IsCSharp12OrAbove(this LanguageVersion languageVersion) 16=> languageVersion >= LanguageVersion.CSharp12; 18public static bool IsCSharp11OrAbove(this LanguageVersion languageVersion) 19=> languageVersion >= LanguageVersion.CSharp11; 21public static bool HasConstantInterpolatedStrings(this LanguageVersion languageVersion) 22=> languageVersion >= LanguageVersion.CSharp10; 24public static bool SupportsCollectionExpressions(this LanguageVersion languageVersion) 27public static bool SupportsPrimaryConstructors(this LanguageVersion languageVersion) 33internal const LanguageVersion CSharpNext = LanguageVersion.Preview;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParseOptionsExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this ParseOptions options)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
508var languageVersion = semanticModel.SyntaxTree.Options.LanguageVersion(); 511return languageVersion >= LanguageVersion.CSharp11 && semanticModel.Compilation.SupportsRuntimeCapability(RuntimeCapability.NumericIntPtr);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
23public static LanguageVersion GetLanguageVersion(this SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (10)
49=> options.LanguageVersion() >= LanguageVersion.CSharp6; 52=> options.LanguageVersion() >= LanguageVersion.CSharp7; 55=> options.LanguageVersion() >= LanguageVersion.CSharp7; 58=> options.LanguageVersion() >= LanguageVersion.CSharp9; 61=> options.LanguageVersion() >= LanguageVersion.CSharp10; 64=> options.LanguageVersion() >= LanguageVersion.CSharp9; 67=> options.LanguageVersion() >= LanguageVersion.CSharp10; 70=> options.LanguageVersion() >= LanguageVersion.CSharp7; 77=> options.LanguageVersion() >= LanguageVersion.CSharp10; 1488=> options.LanguageVersion() >= LanguageVersion.CSharp9;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (1)
21if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1547if (originalSemanticModel.Compilation.LanguageVersion() < LanguageVersion.CSharp9 &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
839=> originalExpression.GetLanguageVersion() >= LanguageVersion.CSharp9;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
318if (!conversion.Exists && expression is LambdaExpressionSyntax && semanticModel.Compilation.LanguageVersion() >= LanguageVersion.CSharp10)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (24)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
39=> options.LanguageVersion() >= LanguageVersion.CSharp7_3;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
41if (root.GetLanguageVersion() < LanguageVersion.CSharp11)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
101parent.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (7)
68private static LanguageVersion RequiredVersion(ImmutableArray<Diagnostic> diagnostics) 70LanguageVersion max = 0; 74LanguageVersionFacts.TryParse(requiredVersion, out var required)) 80max = LanguageVersion.Preview; 92Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion)); 106Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion)); 109var mappedVersion = parsedNewVersion.MapSpecifiedToEffectiveVersion();
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
34private static LambdaExpressionSyntax WithExpressionBody(LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\UseIsNullCheckHelpers.cs (1)
26=> options.LanguageVersion() >= LanguageVersion.CSharp9;
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
89if (languageVersion >= LanguageVersion.CSharp8)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
86LanguageVersion languageVersion, 161LanguageVersion languageVersion, 172if (languageVersion >= LanguageVersion.CSharp9)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationContextInfo.cs (2)
12public readonly LanguageVersion LanguageVersion; 14public CSharpCodeGenerationContextInfo(CodeGenerationContext context, CSharpCodeGenerationOptions options, CSharpCodeGenerationService service, LanguageVersion languageVersion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (1)
110info.LanguageVersion >= LanguageVersion.CSharp10)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (2)
177BasePropertyDeclarationSyntax baseProperty, LanguageVersion languageVersion, ExpressionBodyPreference preference, CancellationToken cancellationToken, 252SyntaxKind declarationKind, AccessorDeclarationSyntax accessor, LanguageVersion languageVersion, ExpressionBodyPreference preference, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (2)
46if (semanticModel.Compilation.LanguageVersion().MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 68var isLanguageVersionGreaterOrEqualToCSharp8 = (semanticModel.Compilation as CSharpCompilation)?.LanguageVersion >= LanguageVersion.CSharp8;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
195=> ((CSharpParseOptions)options).LanguageVersion >= LanguageVersion.CSharp7;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1525)
src\Analyzers\CSharp\Tests\AddAccessibilityModifiers\AddAccessibilityModifiersTests.cs (13)
203LanguageVersion = LanguageVersion.CSharp9, 229LanguageVersion = LanguageVersion.CSharp12, 566LanguageVersion = LanguageVersion.CSharp10, 596LanguageVersion = LanguageVersion.CSharp12, 623LanguageVersion = LanguageVersion.CSharp12, 645LanguageVersion = LanguageVersion.CSharp12, 657LanguageVersion = LanguageVersion.CSharp12, 689LanguageVersion = LanguageVersion.CSharp12, 713LanguageVersion = LanguageVersion.CSharp12, 740LanguageVersion = LanguageVersion.CSharp12, 789LanguageVersion = LanguageVersion.CSharp12, 837LanguageVersion = LanguageVersion.CSharp12, 885LanguageVersion = LanguageVersion.CSharp12,
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\ConvertNamespace\ConvertToBlockScopedNamespaceAnalyzerTests.cs (21)
46LanguageVersion = LanguageVersion.CSharp9, 67LanguageVersion = LanguageVersion.CSharp9, 84LanguageVersion = LanguageVersion.CSharp10, 106LanguageVersion = LanguageVersion.CSharp10, 133LanguageVersion = LanguageVersion.CSharp10, 160LanguageVersion = LanguageVersion.CSharp10, 189LanguageVersion = LanguageVersion.CSharp10, 216LanguageVersion = LanguageVersion.CSharp10, 245LanguageVersion = LanguageVersion.CSharp10, 272LanguageVersion = LanguageVersion.CSharp10, 306LanguageVersion = LanguageVersion.CSharp10, 339LanguageVersion = LanguageVersion.CSharp10, 364LanguageVersion = LanguageVersion.CSharp10, 388LanguageVersion = LanguageVersion.CSharp10, 413LanguageVersion = LanguageVersion.CSharp10, 437LanguageVersion = LanguageVersion.CSharp10, 465LanguageVersion = LanguageVersion.CSharp10, 495LanguageVersion = LanguageVersion.CSharp10, 523LanguageVersion = LanguageVersion.CSharp10, 552LanguageVersion = LanguageVersion.CSharp10, 582LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertNamespace\ConvertToFileScopedNamespaceAnalyzerTests.cs (43)
32LanguageVersion = LanguageVersion.CSharp9, 51LanguageVersion = LanguageVersion.CSharp10, 72LanguageVersion = LanguageVersion.CSharp10, 93LanguageVersion = LanguageVersion.CSharp10, 116LanguageVersion = LanguageVersion.CSharp10, 138LanguageVersion = LanguageVersion.CSharp10, 159LanguageVersion = LanguageVersion.CSharp10, 180LanguageVersion = LanguageVersion.CSharp10, 212LanguageVersion = LanguageVersion.CSharp10, 236LanguageVersion = LanguageVersion.CSharp10, 264LanguageVersion = LanguageVersion.CSharp10, 294LanguageVersion = LanguageVersion.CSharp10, 323LanguageVersion = LanguageVersion.CSharp10, 351LanguageVersion = LanguageVersion.CSharp10, 381LanguageVersion = LanguageVersion.CSharp10, 411LanguageVersion = LanguageVersion.CSharp10, 452LanguageVersion = LanguageVersion.CSharp10, 486LanguageVersion = LanguageVersion.CSharp10, 520LanguageVersion = LanguageVersion.CSharp10, 568LanguageVersion = LanguageVersion.CSharp10, 616LanguageVersion = LanguageVersion.CSharp10, 666LanguageVersion = LanguageVersion.CSharp10, 720LanguageVersion = LanguageVersion.CSharp12, 775LanguageVersion = LanguageVersion.CSharp12, 830LanguageVersion = LanguageVersion.CSharp12, 850LanguageVersion = LanguageVersion.CSharp10, 871LanguageVersion = LanguageVersion.CSharp10, 899LanguageVersion = LanguageVersion.CSharp10, 920LanguageVersion = LanguageVersion.CSharp10, 948LanguageVersion = LanguageVersion.CSharp10, 969LanguageVersion = LanguageVersion.CSharp10, 999LanguageVersion = LanguageVersion.CSharp10, 1031LanguageVersion = LanguageVersion.CSharp10, 1060LanguageVersion = LanguageVersion.CSharp10, 1090LanguageVersion = LanguageVersion.CSharp10, 1162LanguageVersion = LanguageVersion.CSharp11, 1232LanguageVersion = LanguageVersion.CSharp11, 1304LanguageVersion = LanguageVersion.CSharp11, 1390LanguageVersion = LanguageVersion.CSharp11, 1462LanguageVersion = LanguageVersion.CSharp11, 1534LanguageVersion = LanguageVersion.CSharp11, 1555LanguageVersion = LanguageVersion.CSharp10, 1576LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs (6)
27private static readonly LanguageVersion CSharp9 = LanguageVersion.CSharp9; 2163LanguageVersion = LanguageVersion.CSharp9, 2207LanguageVersion = LanguageVersion.CSharp9, 2530LanguageVersion = LanguageVersion.CSharp9, 2587LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
154LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertTypeOfToNameOf\ConvertTypeOfToNameOfTests.cs (1)
361LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\FixReturnType\FixReturnTypeTests.cs (1)
224LanguageVersion = LanguageVersion.CSharp10
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\GenerateDefaultConstructors\GenerateDefaultConstructorsTests.cs (3)
66LanguageVersion = LanguageVersion.CSharp10, 93LanguageVersion = LanguageVersion.CSharp10, 958LanguageVersion = LanguageVersion.CSharp12,
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\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
1836""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
src\Analyzers\CSharp\Tests\ImplementInterface\ImplementInterfaceTests.cs (41)
74LanguageVersion = LanguageVersion.CSharp12, 113LanguageVersion = LanguageVersion.CSharp12, 152LanguageVersion = LanguageVersion.CSharp12, 202LanguageVersion = LanguageVersion.CSharp9, 4060LanguageVersion = LanguageVersion.CSharp7_2, 4099LanguageVersion = LanguageVersion.CSharp8, 8318LanguageVersion = LanguageVersion.CSharp7_1, 10419LanguageVersion = LanguageVersion.CSharp9, 10545LanguageVersion = LanguageVersion.CSharp12, 10578LanguageVersion = LanguageVersion.CSharp12, 10611LanguageVersion = LanguageVersion.CSharp12, 10644LanguageVersion = LanguageVersion.CSharp12, 10681LanguageVersion = LanguageVersion.CSharp12, 10712LanguageVersion = LanguageVersion.CSharp9, 10776LanguageVersion = LanguageVersion.CSharp9, 10813LanguageVersion = LanguageVersion.CSharp9, 10850LanguageVersion = LanguageVersion.CSharp9, 11024LanguageVersion = LanguageVersion.CSharp5, 11071LanguageVersion = LanguageVersion.CSharp12, 11108LanguageVersion = LanguageVersion.CSharp12, 11145LanguageVersion = LanguageVersion.CSharp12, 11182LanguageVersion = LanguageVersion.CSharp12, 11217LanguageVersion = LanguageVersion.CSharp12, 11252LanguageVersion = LanguageVersion.CSharp12, 11294LanguageVersion = LanguageVersion.CSharp12, 11329LanguageVersion = LanguageVersion.CSharp12, 11364LanguageVersion = LanguageVersion.CSharp12, 11400LanguageVersion = LanguageVersion.CSharp12, 11436LanguageVersion = LanguageVersion.CSharp12, 11472LanguageVersion = LanguageVersion.CSharp12, 11508LanguageVersion = LanguageVersion.CSharp12, 11544LanguageVersion = LanguageVersion.CSharp12, 11580LanguageVersion = LanguageVersion.CSharp12, 11656LanguageVersion = LanguageVersion.CSharp12, 11732LanguageVersion = LanguageVersion.CSharp12, 11807LanguageVersion = LanguageVersion.CSharp7_3, 11846LanguageVersion = LanguageVersion.CSharp7_2, 11886LanguageVersion = LanguageVersion.CSharp12, 12035LanguageVersion = LanguageVersion.CSharp12, 12232LanguageVersion = LanguageVersion.CSharp9, 12277LanguageVersion = LanguageVersion.CSharp10,
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\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticTests.cs (3)
26LanguageVersion = LanguageVersion.CSharp9 55LanguageVersion = LanguageVersion.CSharp8 84LanguageVersion = LanguageVersion.CSharp9,
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\MakeMemberRequired\MakeMemberRequiredTests.cs (22)
138LanguageVersion = LanguageVersion.CSharp11, 162LanguageVersion = LanguageVersion.CSharp11, 186LanguageVersion = LanguageVersion.CSharp11, 206LanguageVersion = LanguageVersion.CSharp11, 239LanguageVersion = LanguageVersion.CSharp11, 261LanguageVersion = LanguageVersion.CSharp11, 288LanguageVersion = LanguageVersion.CSharp11, 307LanguageVersion = LanguageVersion.CSharp11, 334LanguageVersion = LanguageVersion.CSharp11, 353LanguageVersion = LanguageVersion.CSharp11, 379LanguageVersion = LanguageVersion.CSharp11, 412LanguageVersion = LanguageVersion.CSharp11, 434LanguageVersion = LanguageVersion.CSharp11, 454LanguageVersion = LanguageVersion.CSharp10, 475LanguageVersion = LanguageVersion.CSharp11, 495LanguageVersion = LanguageVersion.CSharp11, 521LanguageVersion = LanguageVersion.CSharp11, 547LanguageVersion = LanguageVersion.CSharp11, 571LanguageVersion = LanguageVersion.CSharp11, 595LanguageVersion = LanguageVersion.CSharp11, 621LanguageVersion = LanguageVersion.CSharp11, 645LanguageVersion = LanguageVersion.CSharp11,
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\MakeStructMemberReadOnly\MakeStructMemberReadOnlyTests.cs (35)
458LanguageVersion = LanguageVersion.CSharp7, 999LanguageVersion = LanguageVersion.CSharp10, 1408LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1476LanguageVersion = LanguageVersion.CSharp12, 1534LanguageVersion = LanguageVersion.CSharp12, 1592LanguageVersion = LanguageVersion.CSharp12, 1650LanguageVersion = LanguageVersion.CSharp12, 1708LanguageVersion = LanguageVersion.CSharp12, 1728LanguageVersion = LanguageVersion.CSharp12, 1748LanguageVersion = LanguageVersion.CSharp12, 1768LanguageVersion = LanguageVersion.CSharp12, 1791LanguageVersion = LanguageVersion.CSharp12, 1814LanguageVersion = LanguageVersion.CSharp12, 1839LanguageVersion = LanguageVersion.CSharp12, 1880LanguageVersion = LanguageVersion.CSharp12, 1907LanguageVersion = LanguageVersion.CSharp12, 1925LanguageVersion = LanguageVersion.CSharp12, 1966LanguageVersion = LanguageVersion.CSharp12, 2007LanguageVersion = LanguageVersion.CSharp12, 2038LanguageVersion = LanguageVersion.CSharp12, 2058LanguageVersion = LanguageVersion.CSharp12, 2078LanguageVersion = LanguageVersion.CSharp12, 2105LanguageVersion = LanguageVersion.CSharp12, 2149LanguageVersion = LanguageVersion.CSharp12, 2176LanguageVersion = LanguageVersion.CSharp12, 2216LanguageVersion = LanguageVersion.CSharp12, 2264LanguageVersion = LanguageVersion.CSharp12, 2314LanguageVersion = LanguageVersion.CSharp12, 2364LanguageVersion = LanguageVersion.CSharp12, 2424LanguageVersion = LanguageVersion.CSharp12, 2460LanguageVersion = LanguageVersion.CSharp12, 2490LanguageVersion = LanguageVersion.CSharp12, 2520LanguageVersion = LanguageVersion.CSharp12, 2554LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\MakeStructReadOnly\MakeStructReadOnlyTests.cs (7)
23private static Task TestMissingAsync(string testCode, LanguageVersion version = LanguageVersion.CSharp12) 26private static async Task TestAsync(string testCode, string fixedCode, LanguageVersion version = LanguageVersion.CSharp12) 46""", LanguageVersion.CSharp7_1); 65LanguageVersion.CSharp7_2); 450LanguageVersion.CSharp12);
src\Analyzers\CSharp\Tests\MakeTypePartial\MakeTypePartialTests.cs (11)
56LanguageVersion = LanguageVersion.CSharp10 88LanguageVersion = LanguageVersion.CSharp10 122LanguageVersion = LanguageVersion.CSharp10 162LanguageVersion = LanguageVersion.CSharp10 198LanguageVersion = LanguageVersion.CSharp10 226LanguageVersion = LanguageVersion.CSharp10 260LanguageVersion = LanguageVersion.CSharp10 302LanguageVersion = LanguageVersion.CSharp10 341LanguageVersion = LanguageVersion.CSharp10, 350LanguageVersion = LanguageVersion.CSharp10, 379LanguageVersion = LanguageVersion.CSharp10
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (2)
58LanguageVersion = LanguageVersion.CSharp10, 948LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementTests.cs (4)
266LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 345LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 803LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 849LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\NewLines\MultipleBlankLines\MultipleBlankLinesTests.cs (10)
534LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 552LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 578LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 605LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 632LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 770LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 793LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 832LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 875LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 922LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
24private static readonly TestParameters s_nullableFeature = new TestParameters(parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveConfusingSuppression\RemoveConfusingSuppressionTests.cs (4)
104LanguageVersion = LanguageVersion.CSharp8 138LanguageVersion = LanguageVersion.CSharp8, 172LanguageVersion = LanguageVersion.CSharp9, 211LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryCast\RemoveUnnecessaryCastTests.cs (103)
5768LanguageVersion = LanguageVersion.CSharp7_1, 5793LanguageVersion = LanguageVersion.CSharp7_1, 5818LanguageVersion = LanguageVersion.CSharp7_1, 5858LanguageVersion = LanguageVersion.CSharp7_1, 5909LanguageVersion = LanguageVersion.CSharp7_1, 5934LanguageVersion = LanguageVersion.CSharp7_1, 5959LanguageVersion = LanguageVersion.CSharp7_1, 5999LanguageVersion = LanguageVersion.CSharp7_1, 6039LanguageVersion = LanguageVersion.CSharp7_1, 6060LanguageVersion = LanguageVersion.CSharp7_1, 6081LanguageVersion = LanguageVersion.CSharp7_1, 6102LanguageVersion = LanguageVersion.CSharp7_1, 6134LanguageVersion = LanguageVersion.CSharp7_1, 6157LanguageVersion = LanguageVersion.CSharp10, 6180LanguageVersion = LanguageVersion.CSharp10, 8229LanguageVersion = LanguageVersion.CSharp9, 8301LanguageVersion = LanguageVersion.CSharp8 8328LanguageVersion = LanguageVersion.CSharp9, 8349LanguageVersion = LanguageVersion.CSharp8 8376LanguageVersion = LanguageVersion.CSharp9, 8397LanguageVersion = LanguageVersion.CSharp8, 8424LanguageVersion = LanguageVersion.CSharp9, 8496LanguageVersion = LanguageVersion.CSharp8 8523LanguageVersion = LanguageVersion.CSharp9, 8544LanguageVersion = LanguageVersion.CSharp8 8571LanguageVersion = LanguageVersion.CSharp9, 8592LanguageVersion = LanguageVersion.CSharp8 8619LanguageVersion = LanguageVersion.CSharp9, 8797LanguageVersion = LanguageVersion.CSharp9, 9622LanguageVersion = LanguageVersion.CSharp9 9643LanguageVersion = LanguageVersion.CSharp9 9673LanguageVersion = LanguageVersion.CSharp9 9694LanguageVersion = LanguageVersion.CSharp9 9715LanguageVersion = LanguageVersion.CSharp9 9800LanguageVersion = LanguageVersion.CSharp9 9823LanguageVersion = LanguageVersion.CSharp9 9846LanguageVersion = LanguageVersion.CSharp9 9875LanguageVersion = LanguageVersion.CSharp9 9905LanguageVersion = LanguageVersion.CSharp9 9923LanguageVersion = LanguageVersion.CSharp9, 9946LanguageVersion = LanguageVersion.CSharp9, 9982LanguageVersion = LanguageVersion.CSharp9, 10010LanguageVersion = LanguageVersion.CSharp9, 10033LanguageVersion = LanguageVersion.CSharp9, 10055LanguageVersion = LanguageVersion.CSharp9, 10890LanguageVersion = LanguageVersion.CSharp9, 10929LanguageVersion = LanguageVersion.CSharp9, 11629LanguageVersion = LanguageVersion.CSharp10, 12067public async Task DoNotRemoveMethodGroupToSpecificDelegateType(LanguageVersion version) 12123LanguageVersion = LanguageVersion.CSharp10, 12159LanguageVersion = LanguageVersion.CSharp10, 12183LanguageVersion = LanguageVersion.CSharp10, 12205LanguageVersion = LanguageVersion.CSharp10, 12226LanguageVersion = LanguageVersion.CSharp10, 12247LanguageVersion = LanguageVersion.CSharp10, 12270LanguageVersion = LanguageVersion.CSharp10, 12292LanguageVersion = LanguageVersion.CSharp10, 12308LanguageVersion = LanguageVersion.CSharp10, 12330LanguageVersion = LanguageVersion.CSharp10, 12354LanguageVersion = LanguageVersion.CSharp10, 12373LanguageVersion = LanguageVersion.CSharp10, 12392LanguageVersion = LanguageVersion.CSharp10, 12416LanguageVersion = LanguageVersion.CSharp10, 12439LanguageVersion = LanguageVersion.CSharp10, 12470LanguageVersion = LanguageVersion.CSharp10, 12520LanguageVersion = LanguageVersion.CSharp10, 12561LanguageVersion = LanguageVersion.CSharp10, 12588LanguageVersion = LanguageVersion.CSharp10, 12635LanguageVersion = LanguageVersion.CSharp10, 12680LanguageVersion = LanguageVersion.CSharp10, 12699LanguageVersion = LanguageVersion.CSharp10, 12730LanguageVersion = LanguageVersion.CSharp10, 12761LanguageVersion = LanguageVersion.CSharp10, 12792LanguageVersion = LanguageVersion.CSharp10, 12823LanguageVersion = LanguageVersion.CSharp10, 12854LanguageVersion = LanguageVersion.CSharp10, 12885LanguageVersion = LanguageVersion.CSharp10, 12904LanguageVersion = LanguageVersion.CSharp10, 12930LanguageVersion = LanguageVersion.CSharp10, 12966LanguageVersion = LanguageVersion.CSharp10, 13001LanguageVersion = LanguageVersion.CSharp10, 13020LanguageVersion = LanguageVersion.CSharp10, 13075LanguageVersion = LanguageVersion.CSharp10, 13578LanguageVersion = LanguageVersion.CSharp12, 13596LanguageVersion = LanguageVersion.CSharp12, 13621LanguageVersion = LanguageVersion.CSharp12, 13648LanguageVersion = LanguageVersion.CSharp12, 13681LanguageVersion = LanguageVersion.CSharp12, 13704LanguageVersion = LanguageVersion.CSharp12, 13734LanguageVersion = LanguageVersion.CSharp12, 13778LanguageVersion = LanguageVersion.CSharp12, 13815LanguageVersion = LanguageVersion.CSharp12, 13893LanguageVersion = LanguageVersion.CSharp12, 13933LanguageVersion = LanguageVersion.CSharp12, 13954LanguageVersion = LanguageVersion.CSharp12, 13975LanguageVersion = LanguageVersion.CSharp12, 13994LanguageVersion = LanguageVersion.CSharp12, 14013LanguageVersion = LanguageVersion.CSharp12, 14032LanguageVersion = LanguageVersion.CSharp12, 14053LanguageVersion = LanguageVersion.CSharp12, 14074LanguageVersion = LanguageVersion.CSharp12, 14095LanguageVersion = LanguageVersion.CSharp12, 14118LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryDiscardDesignation\RemoveUnnecessaryDiscardDesignationTests.cs (18)
54LanguageVersion = LanguageVersion.CSharp9, 76LanguageVersion = LanguageVersion.CSharp8, 109LanguageVersion = LanguageVersion.CSharp9, 136LanguageVersion = LanguageVersion.CSharp9, 169LanguageVersion = LanguageVersion.CSharp9, 202LanguageVersion = LanguageVersion.CSharp9, 235LanguageVersion = LanguageVersion.CSharp9, 256LanguageVersion = LanguageVersion.CSharp9, 289LanguageVersion = LanguageVersion.CSharp9, 328LanguageVersion = LanguageVersion.CSharp9, 352LanguageVersion = LanguageVersion.CSharp9, 377LanguageVersion = LanguageVersion.CSharp9, 430LanguageVersion = LanguageVersion.CSharp9, 461LanguageVersion = LanguageVersion.CSharp9, 493LanguageVersion = LanguageVersion.CSharp9, 528LanguageVersion = LanguageVersion.CSharp9, 563LanguageVersion = LanguageVersion.CSharp9, 601LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (5)
480LanguageVersion = LanguageVersion.CSharp10, 633LanguageVersion = LanguageVersion.CSharp10, 1030LanguageVersion = LanguageVersion.CSharp5, 1111LanguageVersion = LanguageVersion.CSharp5, 2105LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryLambdaExpression\RemoveUnnecessaryLambdaExpressionTests.cs (6)
28LanguageVersion version = LanguageVersion.CSharp12, 45LanguageVersion version = LanguageVersion.CSharp12, 66""", LanguageVersion.CSharp10); 123LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnreachableCode\RemoveUnreachableCodeTests.cs (7)
919LanguageVersion = LanguageVersion.CSharp9, 942LanguageVersion = LanguageVersion.CSharp9, 967LanguageVersion = LanguageVersion.CSharp9, 998LanguageVersion = LanguageVersion.CSharp9, 1026LanguageVersion = LanguageVersion.CSharp9, 1053LanguageVersion = LanguageVersion.CSharp9, 1078LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.cs (13)
446LanguageVersion = LanguageVersion.CSharp9, 474LanguageVersion = LanguageVersion.CSharp9, 493LanguageVersion = LanguageVersion.CSharp9, 520LanguageVersion = LanguageVersion.CSharp9, 1176LanguageVersion = LanguageVersion.CSharp9, 3124LanguageVersion = LanguageVersion.CSharp9, 3270LanguageVersion = LanguageVersion.CSharp13, 3368LanguageVersion = LanguageVersion.CSharp13, 3402LanguageVersion = LanguageVersion.CSharp13, 3425LanguageVersion = LanguageVersion.CSharp13, 3449LanguageVersion = LanguageVersion.CSharp13, 3480LanguageVersion = LanguageVersion.CSharp13, 3529LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1387""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (61)
961LanguageVersion = LanguageVersion.CSharp6, 2728""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2762""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2767[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 2843LanguageVersion = LanguageVersion.CSharp9, 3002""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3008[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 3071LanguageVersion = LanguageVersion.CSharp9, 3114""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3120[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 3208LanguageVersion = LanguageVersion.CSharp9, 3251""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3288""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 3374LanguageVersion = LanguageVersion.CSharp9, 5466""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7769""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8229""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8245""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8269""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8293""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8313""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8464""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8470[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 8551LanguageVersion = LanguageVersion.CSharp9, 8878""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8916""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8938parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8961parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 9118""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9124[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9156""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9182""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9217LanguageVersion = LanguageVersion.CSharp9, 9228[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9256[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9300""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9339LanguageVersion = LanguageVersion.CSharp9, 9712LanguageVersion = LanguageVersion.CSharp9, 9750LanguageVersion = LanguageVersion.CSharp9, 9791LanguageVersion = LanguageVersion.CSharp9, 9832LanguageVersion = LanguageVersion.CSharp9, 9873LanguageVersion = LanguageVersion.CSharp9, 9914LanguageVersion = LanguageVersion.CSharp9, 9955LanguageVersion = LanguageVersion.CSharp11, 9997LanguageVersion = LanguageVersion.CSharp11, 10039LanguageVersion = LanguageVersion.CSharp11, 10062LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (25)
24private static readonly ImmutableArray<LanguageVersion> s_csharp7_1above = 25[LanguageVersion.CSharp7_1, LanguageVersion.Latest]; 27private static readonly ImmutableArray<LanguageVersion> s_csharp7below = 29LanguageVersion.CSharp7, 30LanguageVersion.CSharp6, 31LanguageVersion.CSharp5, 32LanguageVersion.CSharp4, 33LanguageVersion.CSharp3, 34LanguageVersion.CSharp2, 35LanguageVersion.CSharp1, 38private async Task TestWithLanguageVersionsAsync(string initialMarkup, string expectedMarkup, ImmutableArray<LanguageVersion> versions) 40foreach (var version in versions) 47private async Task TestMissingWithLanguageVersionsAsync(string initialMarkup, ImmutableArray<LanguageVersion> versions) 49foreach (var version in versions) 808""", [LanguageVersion.CSharp7_1, LanguageVersion.CSharp10, LanguageVersion.CSharp11, LanguageVersion.Latest]); 863""", [LanguageVersion.CSharp7_1, LanguageVersion.CSharp10, LanguageVersion.CSharp11, LanguageVersion.Latest]); 953""", [LanguageVersion.CSharp7_1]); 979""", [LanguageVersion.Latest]);
src\Analyzers\CSharp\Tests\TransposeRecordKeyword\TransposeRecordKeywordTests.cs (10)
27LanguageVersion = LanguageVersion.CSharp10 38LanguageVersion = LanguageVersion.CSharp10 49LanguageVersion = LanguageVersion.CSharp10 66LanguageVersion = LanguageVersion.CSharp10 83LanguageVersion = LanguageVersion.CSharp10 100LanguageVersion = LanguageVersion.CSharp10 115LanguageVersion = LanguageVersion.CSharp10 136LanguageVersion = LanguageVersion.CSharp10 161LanguageVersion = LanguageVersion.CSharp10 182LanguageVersion = LanguageVersion.CSharp10
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (111)
33LanguageVersion expected, 77LanguageVersion.CSharp8, 78new CSharpParseOptions(LanguageVersion.CSharp7_2)); 91LanguageVersion.CSharp8, 92new CSharpParseOptions(LanguageVersion.CSharp7)); 108LanguageVersion.CSharp7, 109new CSharpParseOptions(LanguageVersion.CSharp6)); 125LanguageVersion.CSharp6, 126new CSharpParseOptions(LanguageVersion.CSharp5)); 142LanguageVersion.CSharp5, 143new CSharpParseOptions(LanguageVersion.CSharp4)); 153#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 156LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 157new CSharpParseOptions(LanguageVersion.CSharp7)); 190LanguageVersion.CSharp7_1, 191new CSharpParseOptions(LanguageVersion.CSharp7)); 201#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 204LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 205new CSharpParseOptions(LanguageVersion.CSharp7_1)); 218LanguageVersion.CSharp7_1, 219new CSharpParseOptions(LanguageVersion.CSharp7)); 235LanguageVersion.CSharp7_2, 236new CSharpParseOptions(LanguageVersion.CSharp7_1)); 254LanguageVersion.CSharp7_1, 255new CSharpParseOptions(LanguageVersion.CSharp7)); 266#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 269LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 270new CSharpParseOptions(LanguageVersion.CSharp7_2)); 285LanguageVersion.CSharp7_3, 286new CSharpParseOptions(LanguageVersion.CSharp7_2)); 298LanguageVersion.CSharp7_3, 299new CSharpParseOptions(LanguageVersion.CSharp7_2)); 311LanguageVersion.CSharp7_3, 312new CSharpParseOptions(LanguageVersion.CSharp7_2)); 324LanguageVersion.CSharp7_3, 325new CSharpParseOptions(LanguageVersion.CSharp7_2)); 337#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 340LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 341new CSharpParseOptions(LanguageVersion.CSharp7_3)); 351#error version:[|{{LanguageVersion.CSharp8.ToDisplayString()}}|] 354LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 355new CSharpParseOptions(LanguageVersion.CSharp7_3)); 371expected: LanguageVersion.CSharp8, 372new CSharpParseOptions(LanguageVersion.CSharp7_3)); 401LanguageVersion.CSharp7, 428LanguageVersion.CSharp8, 459LanguageVersion.CSharp8, 485LanguageVersion.CSharp9, 610var defaultVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion().ToDisplayString(); 664var defaultEffectiveVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion().ToDisplayString(); 702LanguageVersion.CSharp9, 703new CSharpParseOptions(LanguageVersion.CSharp8)); 715LanguageVersion.CSharp7_3, 716new CSharpParseOptions(LanguageVersion.CSharp7)); 748LanguageVersion.CSharp7_3, 749new CSharpParseOptions(LanguageVersion.CSharp7)); 777LanguageVersion.CSharp7_3, 778new CSharpParseOptions(LanguageVersion.CSharp7)); 811LanguageVersion.CSharp7_3, 812new CSharpParseOptions(LanguageVersion.CSharp7)); 848expected: LanguageVersion.CSharp8, 849new CSharpParseOptions(LanguageVersion.CSharp7_3)); 877new CSharpParseOptions(LanguageVersion.CSharp7_3)); 890LanguageVersion.CSharp8, 891new CSharpParseOptions(LanguageVersion.CSharp7_3)); 904LanguageVersion.CSharp8, 905new CSharpParseOptions(LanguageVersion.CSharp7_3)); 918LanguageVersion.CSharp8, 919new CSharpParseOptions(LanguageVersion.CSharp7_3)); 931LanguageVersion.CSharp8, 932new CSharpParseOptions(LanguageVersion.CSharp7_3)); 964LanguageVersion.CSharp8, 965new CSharpParseOptions(LanguageVersion.CSharp7_3)); 993LanguageVersion.CSharp8, 994new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1027LanguageVersion.CSharp8, 1028new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1064expected: LanguageVersion.CSharp9, 1065new CSharpParseOptions(LanguageVersion.CSharp8)); 1090expected: LanguageVersion.CSharp10, 1091new CSharpParseOptions(LanguageVersion.CSharp9)); 1101LanguageVersion.CSharp12, 1102new CSharpParseOptions(LanguageVersion.CSharp11)); 1112LanguageVersion.CSharp12, 1113new CSharpParseOptions(LanguageVersion.CSharp11)); 1123LanguageVersion.CSharp12, 1124new CSharpParseOptions(LanguageVersion.CSharp11)); 1134LanguageVersion.CSharp12, 1135new CSharpParseOptions(LanguageVersion.CSharp11)); 1145LanguageVersion.CSharp12, 1146new CSharpParseOptions(LanguageVersion.CSharp11)); 1156LanguageVersion.CSharp12, 1157new CSharpParseOptions(LanguageVersion.CSharp11)); 1169LanguageVersion.CSharp9, 1170new CSharpParseOptions(LanguageVersion.CSharp8)); 1179LanguageVersion.CSharp10, 1180new CSharpParseOptions(LanguageVersion.CSharp9)); 1198expected: LanguageVersion.CSharp10, 1199new CSharpParseOptions(LanguageVersion.CSharp9)); 1214expected: LanguageVersion.CSharp9, 1215new CSharpParseOptions(LanguageVersion.CSharp8)); 1232expected: LanguageVersion.CSharp11, 1233new CSharpParseOptions(LanguageVersion.CSharp8)); 1246expected: LanguageVersion.CSharp11, 1247new CSharpParseOptions(LanguageVersion.CSharp10)); 1260expected: LanguageVersion.CSharp11, 1261new CSharpParseOptions(LanguageVersion.CSharp10)); 1274expected: LanguageVersion.CSharp11, 1275new CSharpParseOptions(LanguageVersion.CSharp10)); 1291expected: LanguageVersion.CSharp12, 1292new CSharpParseOptions(LanguageVersion.CSharp11));
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\UseCoalesceExpression\UseCoalesceExpressionForIfNullStatementCheckTests.cs (3)
181LanguageVersion = LanguageVersion.CSharp9, 251LanguageVersion = LanguageVersion.CSharp9, 448LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForArrayTests.cs (26)
35LanguageVersion = LanguageVersion.CSharp11, 56LanguageVersion = LanguageVersion.CSharp12, 77LanguageVersion = LanguageVersion.CSharp12, 98LanguageVersion = LanguageVersion.CSharp12, 123LanguageVersion = LanguageVersion.CSharp12, 148LanguageVersion = LanguageVersion.CSharp12, 169LanguageVersion = LanguageVersion.CSharp12, 190LanguageVersion = LanguageVersion.CSharp12, 205LanguageVersion = LanguageVersion.CSharp12, 230LanguageVersion = LanguageVersion.CSharp12, 251LanguageVersion = LanguageVersion.CSharp12, 278LanguageVersion = LanguageVersion.CSharp12, 299LanguageVersion = LanguageVersion.CSharp12, 320LanguageVersion = LanguageVersion.CSharp12, 341LanguageVersion = LanguageVersion.CSharp12, 356LanguageVersion = LanguageVersion.CSharp12, 371LanguageVersion = LanguageVersion.CSharp12, 386LanguageVersion = LanguageVersion.CSharp12, 407LanguageVersion = LanguageVersion.CSharp12, 422LanguageVersion = LanguageVersion.CSharp12, 447LanguageVersion = LanguageVersion.CSharp12, 474LanguageVersion = LanguageVersion.CSharp12, 489LanguageVersion = LanguageVersion.CSharp12, 510LanguageVersion = LanguageVersion.CSharp12, 529LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForBuilderTests.cs (44)
84LanguageVersion = LanguageVersion.CSharp11, 107LanguageVersion = LanguageVersion.CSharp12, 141LanguageVersion = LanguageVersion.CSharp12, 175LanguageVersion = LanguageVersion.CSharp12, 199LanguageVersion = LanguageVersion.CSharp12, 237LanguageVersion = LanguageVersion.CSharp12, 275LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 351LanguageVersion = LanguageVersion.CSharp12, 377LanguageVersion = LanguageVersion.CSharp12, 401LanguageVersion = LanguageVersion.CSharp12, 442LanguageVersion = LanguageVersion.CSharp12, 485LanguageVersion = LanguageVersion.CSharp12, 515LanguageVersion = LanguageVersion.CSharp12, 545LanguageVersion = LanguageVersion.CSharp12, 592LanguageVersion = LanguageVersion.CSharp12, 639LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 726LanguageVersion = LanguageVersion.CSharp12, 768LanguageVersion = LanguageVersion.CSharp12, 810LanguageVersion = LanguageVersion.CSharp12, 856LanguageVersion = LanguageVersion.CSharp12, 894LanguageVersion = LanguageVersion.CSharp12, 932LanguageVersion = LanguageVersion.CSharp12, 970LanguageVersion = LanguageVersion.CSharp12, 995LanguageVersion = LanguageVersion.CSharp12, 1034LanguageVersion = LanguageVersion.CSharp12, 1072LanguageVersion = LanguageVersion.CSharp12, 1110LanguageVersion = LanguageVersion.CSharp12, 1148LanguageVersion = LanguageVersion.CSharp12, 1186LanguageVersion = LanguageVersion.CSharp12, 1212LanguageVersion = LanguageVersion.CSharp12, 1238LanguageVersion = LanguageVersion.CSharp12, 1278LanguageVersion = LanguageVersion.CSharp12, 1317LanguageVersion = LanguageVersion.CSharp12, 1360LanguageVersion = LanguageVersion.CSharp12, 1383LanguageVersion = LanguageVersion.CSharp12, 1405LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1482LanguageVersion = LanguageVersion.CSharp12, 1521LanguageVersion = LanguageVersion.CSharp12, 1559LanguageVersion = LanguageVersion.CSharp12, 1584LanguageVersion = LanguageVersion.CSharp12, 1625LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForCreateTests.cs (52)
77LanguageVersion = LanguageVersion.CSharp11, 99LanguageVersion = LanguageVersion.CSharp12, 121LanguageVersion = LanguageVersion.CSharp12, 149LanguageVersion = LanguageVersion.CSharp12, 170LanguageVersion = LanguageVersion.CSharp12, 192LanguageVersion = LanguageVersion.CSharp12, 214LanguageVersion = LanguageVersion.CSharp12, 236LanguageVersion = LanguageVersion.CSharp12, 258LanguageVersion = LanguageVersion.CSharp12, 280LanguageVersion = LanguageVersion.CSharp12, 296LanguageVersion = LanguageVersion.CSharp12, 318LanguageVersion = LanguageVersion.CSharp12, 340LanguageVersion = LanguageVersion.CSharp12, 362LanguageVersion = LanguageVersion.CSharp12, 378LanguageVersion = LanguageVersion.CSharp12, 394LanguageVersion = LanguageVersion.CSharp12, 416LanguageVersion = LanguageVersion.CSharp12, 438LanguageVersion = LanguageVersion.CSharp12, 460LanguageVersion = LanguageVersion.CSharp12, 476LanguageVersion = LanguageVersion.CSharp12, 508LanguageVersion = LanguageVersion.CSharp12, 530LanguageVersion = LanguageVersion.CSharp12, 552LanguageVersion = LanguageVersion.CSharp12, 574LanguageVersion = LanguageVersion.CSharp12, 596LanguageVersion = LanguageVersion.CSharp12, 614LanguageVersion = LanguageVersion.CSharp12, 632LanguageVersion = LanguageVersion.CSharp12, 658LanguageVersion = LanguageVersion.CSharp12, 684LanguageVersion = LanguageVersion.CSharp12, 710LanguageVersion = LanguageVersion.CSharp12, 736LanguageVersion = LanguageVersion.CSharp12, 762LanguageVersion = LanguageVersion.CSharp12, 788LanguageVersion = LanguageVersion.CSharp12, 807LanguageVersion = LanguageVersion.CSharp12, 829LanguageVersion = LanguageVersion.CSharp12, 853LanguageVersion = LanguageVersion.CSharp12, 884LanguageVersion = LanguageVersion.CSharp12, 906LanguageVersion = LanguageVersion.CSharp12, 940LanguageVersion = LanguageVersion.CSharp12, 962LanguageVersion = LanguageVersion.CSharp12, 996LanguageVersion = LanguageVersion.CSharp12, 1012LanguageVersion = LanguageVersion.CSharp12, 1040LanguageVersion = LanguageVersion.CSharp12, 1078LanguageVersion = LanguageVersion.CSharp12, 1115LanguageVersion = LanguageVersion.CSharp12, 1156LanguageVersion = LanguageVersion.CSharp12, 1181LanguageVersion = LanguageVersion.CSharp12, 1206LanguageVersion = LanguageVersion.CSharp12, 1240LanguageVersion = LanguageVersion.CSharp12, 1266LanguageVersion = LanguageVersion.CSharp12, 1284LanguageVersion = LanguageVersion.CSharp12, 1324LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForEmptyTests.cs (49)
51LanguageVersion = LanguageVersion.CSharp12, 82LanguageVersion = LanguageVersion.CSharp12, 113LanguageVersion = LanguageVersion.CSharp12, 142LanguageVersion = LanguageVersion.CSharp12, 161LanguageVersion = LanguageVersion.CSharp12, 198LanguageVersion = LanguageVersion.CSharp12, 219LanguageVersion = LanguageVersion.CSharp12, 254LanguageVersion = LanguageVersion.CSharp12, 287LanguageVersion = LanguageVersion.CSharp12, 320LanguageVersion = LanguageVersion.CSharp12, 353LanguageVersion = LanguageVersion.CSharp12, 386LanguageVersion = LanguageVersion.CSharp12, 417LanguageVersion = LanguageVersion.CSharp12, 438LanguageVersion = LanguageVersion.CSharp12, 471LanguageVersion = LanguageVersion.CSharp12, 496LanguageVersion = LanguageVersion.CSharp12, 553LanguageVersion = LanguageVersion.CSharp12, 621LanguageVersion = LanguageVersion.CSharp12, 689LanguageVersion = LanguageVersion.CSharp12, 721LanguageVersion = LanguageVersion.CSharp12, 742LanguageVersion = LanguageVersion.CSharp12, 776LanguageVersion = LanguageVersion.CSharp12, 798LanguageVersion = LanguageVersion.CSharp12, 832LanguageVersion = LanguageVersion.CSharp12, 865LanguageVersion = LanguageVersion.CSharp12, 900LanguageVersion = LanguageVersion.CSharp12, 951LanguageVersion = LanguageVersion.CSharp12, 989LanguageVersion = LanguageVersion.CSharp12, 1041LanguageVersion = LanguageVersion.CSharp12, 1094LanguageVersion = LanguageVersion.CSharp12, 1149LanguageVersion = LanguageVersion.CSharp12, 1187LanguageVersion = LanguageVersion.CSharp12, 1244LanguageVersion = LanguageVersion.CSharp12, 1268LanguageVersion = LanguageVersion.CSharp12, 1288LanguageVersion = LanguageVersion.CSharp12, 1315LanguageVersion = LanguageVersion.CSharp12, 1352LanguageVersion = LanguageVersion.CSharp12, 1382LanguageVersion = LanguageVersion.CSharp12, 1412LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1472LanguageVersion = LanguageVersion.CSharp12, 1508LanguageVersion = LanguageVersion.CSharp12, 1548LanguageVersion = LanguageVersion.CSharp12, 1586LanguageVersion = LanguageVersion.CSharp12, 1609LanguageVersion = LanguageVersion.CSharp12, 1632LanguageVersion = LanguageVersion.CSharp12, 1669LanguageVersion = LanguageVersion.CSharp12, 1694LanguageVersion = LanguageVersion.CSharp12, 1716LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForFluentTests.cs (92)
39LanguageVersion = LanguageVersion.CSharp11, 73LanguageVersion = LanguageVersion.CSharp12, 107LanguageVersion = LanguageVersion.CSharp12, 141LanguageVersion = LanguageVersion.CSharp12, 164LanguageVersion = LanguageVersion.CSharp12, 198LanguageVersion = LanguageVersion.CSharp12, 232LanguageVersion = LanguageVersion.CSharp12, 254LanguageVersion = LanguageVersion.CSharp12, 290LanguageVersion = LanguageVersion.CSharp12, 326LanguageVersion = LanguageVersion.CSharp12, 362LanguageVersion = LanguageVersion.CSharp12, 398LanguageVersion = LanguageVersion.CSharp12, 434LanguageVersion = LanguageVersion.CSharp12, 470LanguageVersion = LanguageVersion.CSharp12, 506LanguageVersion = LanguageVersion.CSharp12, 542LanguageVersion = LanguageVersion.CSharp12, 578LanguageVersion = LanguageVersion.CSharp12, 614LanguageVersion = LanguageVersion.CSharp12, 650LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 709LanguageVersion = LanguageVersion.CSharp12, 732LanguageVersion = LanguageVersion.CSharp12, 755LanguageVersion = LanguageVersion.CSharp12, 795LanguageVersion = LanguageVersion.CSharp12, 831LanguageVersion = LanguageVersion.CSharp12, 854LanguageVersion = LanguageVersion.CSharp12, 898LanguageVersion = LanguageVersion.CSharp12, 934LanguageVersion = LanguageVersion.CSharp12, 957LanguageVersion = LanguageVersion.CSharp12, 993LanguageVersion = LanguageVersion.CSharp12, 1029LanguageVersion = LanguageVersion.CSharp12, 1071LanguageVersion = LanguageVersion.CSharp12, 1118LanguageVersion = LanguageVersion.CSharp12, 1160LanguageVersion = LanguageVersion.CSharp12, 1207LanguageVersion = LanguageVersion.CSharp12, 1233LanguageVersion = LanguageVersion.CSharp12, 1259LanguageVersion = LanguageVersion.CSharp12, 1285LanguageVersion = LanguageVersion.CSharp12, 1310LanguageVersion = LanguageVersion.CSharp12, 1335LanguageVersion = LanguageVersion.CSharp12, 1371LanguageVersion = LanguageVersion.CSharp12, 1407LanguageVersion = LanguageVersion.CSharp12, 1443LanguageVersion = LanguageVersion.CSharp12, 1481LanguageVersion = LanguageVersion.CSharp12, 1519LanguageVersion = LanguageVersion.CSharp12, 1543LanguageVersion = LanguageVersion.CSharp12, 1570LanguageVersion = LanguageVersion.CSharp12, 1608LanguageVersion = LanguageVersion.CSharp12, 1646LanguageVersion = LanguageVersion.CSharp12, 1684LanguageVersion = LanguageVersion.CSharp12, 1728LanguageVersion = LanguageVersion.CSharp12, 1772LanguageVersion = LanguageVersion.CSharp12, 1810LanguageVersion = LanguageVersion.CSharp12, 1848LanguageVersion = LanguageVersion.CSharp12, 1894LanguageVersion = LanguageVersion.CSharp12, 1939LanguageVersion = LanguageVersion.CSharp12, 1973LanguageVersion = LanguageVersion.CSharp12, 1995LanguageVersion = LanguageVersion.CSharp12, 2031LanguageVersion = LanguageVersion.CSharp12, 2079LanguageVersion = LanguageVersion.CSharp12, 2114LanguageVersion = LanguageVersion.CSharp12, 2149LanguageVersion = LanguageVersion.CSharp12, 2183LanguageVersion = LanguageVersion.CSharp12, 2206LanguageVersion = LanguageVersion.CSharp12, 2242LanguageVersion = LanguageVersion.CSharp12, 2265LanguageVersion = LanguageVersion.CSharp12, 2301LanguageVersion = LanguageVersion.CSharp12, 2324LanguageVersion = LanguageVersion.CSharp12, 2360LanguageVersion = LanguageVersion.CSharp12, 2398LanguageVersion = LanguageVersion.CSharp12, 2432LanguageVersion = LanguageVersion.CSharp12, 2466LanguageVersion = LanguageVersion.CSharp12, 2501LanguageVersion = LanguageVersion.CSharp12, 2536LanguageVersion = LanguageVersion.CSharp12, 2573LanguageVersion = LanguageVersion.CSharp12, 2610LanguageVersion = LanguageVersion.CSharp12, 2650LanguageVersion = LanguageVersion.CSharp12, 2674LanguageVersion = LanguageVersion.CSharp12, 2698LanguageVersion = LanguageVersion.CSharp12, 2726LanguageVersion = LanguageVersion.CSharp12, 2777LanguageVersion = LanguageVersion.CSharp12, 2810LanguageVersion = LanguageVersion.CSharp12, 2832LanguageVersion = LanguageVersion.CSharp12, 2872LanguageVersion = LanguageVersion.CSharp12, 2908LanguageVersion = LanguageVersion.CSharp12, 2935LanguageVersion = LanguageVersion.CSharp12, 2978LanguageVersion = LanguageVersion.CSharp12, 3012LanguageVersion = LanguageVersion.CSharp12, 3046LanguageVersion = LanguageVersion.CSharp12, 3080LanguageVersion = LanguageVersion.CSharp12, 3114LanguageVersion = LanguageVersion.CSharp12, 3150LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForNewTests.cs (2)
55LanguageVersion = LanguageVersion.CSharp12, 93LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForStackAllocTests.cs (56)
38LanguageVersion = LanguageVersion.CSharp11, 59LanguageVersion = LanguageVersion.CSharp11, 80LanguageVersion = LanguageVersion.CSharp12, 101LanguageVersion = LanguageVersion.CSharp12, 133LanguageVersion = LanguageVersion.CSharp12, 165LanguageVersion = LanguageVersion.CSharp12, 197LanguageVersion = LanguageVersion.CSharp12, 229LanguageVersion = LanguageVersion.CSharp12, 250LanguageVersion = LanguageVersion.CSharp12, 271LanguageVersion = LanguageVersion.CSharp12, 292LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 347LanguageVersion = LanguageVersion.CSharp12, 368LanguageVersion = LanguageVersion.CSharp12, 389LanguageVersion = LanguageVersion.CSharp12, 410LanguageVersion = LanguageVersion.CSharp12, 431LanguageVersion = LanguageVersion.CSharp12, 467LanguageVersion = LanguageVersion.CSharp12, 503LanguageVersion = LanguageVersion.CSharp12, 535LanguageVersion = LanguageVersion.CSharp12, 567LanguageVersion = LanguageVersion.CSharp12, 589LanguageVersion = LanguageVersion.CSharp12, 621LanguageVersion = LanguageVersion.CSharp12, 642LanguageVersion = LanguageVersion.CSharp12, 674LanguageVersion = LanguageVersion.CSharp12, 695LanguageVersion = LanguageVersion.CSharp12, 717LanguageVersion = LanguageVersion.CSharp12, 741LanguageVersion = LanguageVersion.CSharp12, 763LanguageVersion = LanguageVersion.CSharp12, 785LanguageVersion = LanguageVersion.CSharp12, 809LanguageVersion = LanguageVersion.CSharp12, 833LanguageVersion = LanguageVersion.CSharp12, 855LanguageVersion = LanguageVersion.CSharp12, 877LanguageVersion = LanguageVersion.CSharp12, 900LanguageVersion = LanguageVersion.CSharp12, 933LanguageVersion = LanguageVersion.CSharp12, 968LanguageVersion = LanguageVersion.CSharp12, 1002LanguageVersion = LanguageVersion.CSharp12, 1038LanguageVersion = LanguageVersion.CSharp12, 1061LanguageVersion = LanguageVersion.CSharp12, 1085LanguageVersion = LanguageVersion.CSharp12, 1111LanguageVersion = LanguageVersion.CSharp12, 1151LanguageVersion = LanguageVersion.CSharp12, 1191LanguageVersion = LanguageVersion.CSharp12, 1229LanguageVersion = LanguageVersion.CSharp12, 1269LanguageVersion = LanguageVersion.CSharp12, 1305LanguageVersion = LanguageVersion.CSharp12, 1343LanguageVersion = LanguageVersion.CSharp12, 1381LanguageVersion = LanguageVersion.CSharp12, 1421LanguageVersion = LanguageVersion.CSharp12, 1457LanguageVersion = LanguageVersion.CSharp12, 1495LanguageVersion = LanguageVersion.CSharp12, 1533LanguageVersion = LanguageVersion.CSharp12, 1575LanguageVersion = LanguageVersion.CSharp12, 1595LanguageVersion = LanguageVersion.CSharp12, 1631LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionInitializer\UseCollectionInitializerTests.cs (10)
26LanguageVersion languageVersion = LanguageVersion.CSharp11) 40private static async Task TestMissingInRegularAndScriptAsync(string testCode, LanguageVersion? languageVersion = null) 343""", LanguageVersion.CSharp5); 603""", LanguageVersion.CSharp2); 1682""", OutputKind.ConsoleApplication, LanguageVersion.CSharp12); 1714""", languageVersion: LanguageVersion.CSharp12); 1748LanguageVersion = LanguageVersion.CSharp12, 1785LanguageVersion = LanguageVersion.CSharp12, 1826LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionInitializer\UseCollectionInitializerTests_CollectionExpression.cs (24)
31LanguageVersion = LanguageVersion.CSharp12, 375LanguageVersion = LanguageVersion.CSharp12, 798LanguageVersion = LanguageVersion.CSharp12, 823LanguageVersion = LanguageVersion.CSharp12, 1941LanguageVersion = LanguageVersion.CSharp12, 4385LanguageVersion = LanguageVersion.CSharp12, 5346LanguageVersion = LanguageVersion.CSharp12, 5386LanguageVersion = LanguageVersion.CSharp12, 5423LanguageVersion = LanguageVersion.CSharp12, 5457LanguageVersion = LanguageVersion.CSharp12, 5491LanguageVersion = LanguageVersion.CSharp12, 5525LanguageVersion = LanguageVersion.CSharp12, 5569LanguageVersion = LanguageVersion.CSharp12, 5603LanguageVersion = LanguageVersion.CSharp12, 5637LanguageVersion = LanguageVersion.CSharp12, 5681LanguageVersion = LanguageVersion.CSharp12, 5705LanguageVersion = LanguageVersion.CSharp12, 5743LanguageVersion = LanguageVersion.CSharp12, 5777LanguageVersion = LanguageVersion.CSharp12, 5811LanguageVersion = LanguageVersion.CSharp12, 5865LanguageVersion = LanguageVersion.CSharp12, 5887LanguageVersion = LanguageVersion.CSharp13, 5908LanguageVersion = LanguageVersion.CSharp13, 5940LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseCompoundAssignment\UseCompoundAssignmentTests.cs (4)
266LanguageVersion = LanguageVersion.CSharp8 286LanguageVersion = LanguageVersion.CSharp7_3 307LanguageVersion = LanguageVersion.CSharp8 959LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseCompoundAssignment\UseCompoundCoalesceAssignmentTests.cs (7)
31private static async Task TestMissingAsync(string testCode, LanguageVersion languageVersion = LanguageVersion.CSharp8) 71""", LanguageVersion.CSharp7_3); 297""", LanguageVersion.CSharp7_3); 957""", LanguageVersion.CSharp12); 977""", LanguageVersion.CSharp12); 1000""", LanguageVersion.CSharp12);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForAssignmentTests.cs (13)
26LanguageVersion languageVersion = LanguageVersion.CSharp8, 42LanguageVersion languageVersion = LanguageVersion.CSharp8, 197""", LanguageVersion.CSharp6); 589""", LanguageVersion.Latest); 987""", LanguageVersion.CSharp8, PreferImplicitTypeAlways); 1019""", LanguageVersion.CSharp9, options: PreferImplicitTypeAlways); 1179""", LanguageVersion.CSharp8, PreferImplicitTypeAlways); 1211""", LanguageVersion.CSharp9, options: PreferImplicitTypeAlways); 1903""", LanguageVersion.CSharp9); 1949""", LanguageVersion.CSharp9, equivalenceKey: nameof(AnalyzersResources.Simplify_check)); 2141LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (15)
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))); 977[InlineData(LanguageVersion.CSharp8, "(string)null")] 978[InlineData(LanguageVersion.CSharp9, "null")] 979public async Task TestConversion2_Throw1(LanguageVersion languageVersion, string expectedFalseExpression) 1043[InlineData(LanguageVersion.CSharp8, "(string)null")] 1044[InlineData(LanguageVersion.CSharp9, "null")] 1045public async Task TestConversion3(LanguageVersion languageVersion, string expectedFalseExpression) 1078[InlineData(LanguageVersion.CSharp8, "(string)null")] 1079[InlineData(LanguageVersion.CSharp9, "null")] 1080public async Task TestConversion3_Throw1(LanguageVersion languageVersion, string expectedFalseExpression) 1113[InlineData(LanguageVersion.CSharp8, "(string)null")] 1114[InlineData(LanguageVersion.CSharp9, "null")] 1115public async Task TestConversion3_Throw2(LanguageVersion languageVersion, string expectedTrue)
src\Analyzers\CSharp\Tests\UseDeconstruction\UseDeconstructionTests.cs (3)
539LanguageVersion = LanguageVersion.CSharp7_1 877LanguageVersion = LanguageVersion.CSharp9 912LanguageVersion = LanguageVersion.CSharp9
src\Analyzers\CSharp\Tests\UseDefaultLiteral\UseDefaultLiteralTests.cs (30)
37LanguageVersion = LanguageVersion.CSharp7 62LanguageVersion = LanguageVersion.CSharp7_1 89LanguageVersion = LanguageVersion.CSharp7_1 116LanguageVersion = LanguageVersion.CSharp7_1 136LanguageVersion = LanguageVersion.CSharp7_1 167LanguageVersion = LanguageVersion.CSharp7_1 189LanguageVersion = LanguageVersion.CSharp7_1 216LanguageVersion = LanguageVersion.CSharp7_1 236LanguageVersion = LanguageVersion.CSharp7_1 256LanguageVersion = LanguageVersion.CSharp7_1 287LanguageVersion = LanguageVersion.CSharp7_1 310LanguageVersion = LanguageVersion.CSharp7_1 337LanguageVersion = LanguageVersion.CSharp7_1, 366LanguageVersion = LanguageVersion.CSharp7_1, 397LanguageVersion = LanguageVersion.CSharp7_1 424LanguageVersion = LanguageVersion.CSharp7_1 453LanguageVersion = LanguageVersion.CSharp7_1 479LanguageVersion = LanguageVersion.CSharp7_1 505LanguageVersion = LanguageVersion.CSharp7_1 538LanguageVersion = LanguageVersion.CSharp7_1 561LanguageVersion = LanguageVersion.CSharp7_1 584LanguageVersion = LanguageVersion.CSharp7_1 617LanguageVersion = LanguageVersion.CSharp7_1 640LanguageVersion = LanguageVersion.CSharp7_1 663LanguageVersion = LanguageVersion.CSharp7_1 696LanguageVersion = LanguageVersion.CSharp7_1 729LanguageVersion = LanguageVersion.CSharp7_1 749LanguageVersion = LanguageVersion.CSharp7_1 769LanguageVersion = LanguageVersion.CSharp7_1 796LanguageVersion = LanguageVersion.CSharp7_1
src\Analyzers\CSharp\Tests\UseExplicitArrayInExpressionTree\UseExplicitArrayInExpressionTreeTests.cs (16)
56LanguageVersion = LanguageVersion.CSharp13, 94LanguageVersion = LanguageVersion.CSharp13, 117LanguageVersion = LanguageVersion.CSharp13, 140LanguageVersion = LanguageVersion.CSharp13, 163LanguageVersion = LanguageVersion.CSharp13, 201LanguageVersion = LanguageVersion.CSharp13, 239LanguageVersion = LanguageVersion.CSharp13, 277LanguageVersion = LanguageVersion.CSharp13, 315LanguageVersion = LanguageVersion.CSharp13, 353LanguageVersion = LanguageVersion.CSharp13, 391LanguageVersion = LanguageVersion.CSharp13, 429LanguageVersion = LanguageVersion.CSharp13, 473LanguageVersion = LanguageVersion.CSharp13, 517LanguageVersion = LanguageVersion.CSharp13, 561LanguageVersion = LanguageVersion.CSharp13, 605LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseExplicitTupleName\UseExplicitTupleNameTests.cs (1)
299LanguageVersion = LanguageVersion.CSharp11
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForAccessorsAnalyzerTests.cs (15)
29LanguageVersion version = LanguageVersion.CSharp8) 33ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 51LanguageVersion version = LanguageVersion.CSharp8) 55ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 71LanguageVersion version = LanguageVersion.CSharp8) 75ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 269await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp9); 308LanguageVersion = LanguageVersion.CSharp9, 505await TestWithUseBlockBodyIncludingPropertiesAndIndexers(code, fixedCode, LanguageVersion.CSharp9); 888LanguageVersion = LanguageVersion.CSharp9, 921await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 955await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForConstructorsAnalyzerTests.cs (4)
24private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 273await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 302await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForLocalFunctionsAnalyzerTests.cs (2)
912LanguageVersion = LanguageVersion.CSharp9, 941LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForMethodsAnalyzerTests.cs (7)
25private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 862await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp5); 875await TestWithUseExpressionBody(code, code, LanguageVersion.CSharp6); 895await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 909await TestWithUseExpressionBody(code, code, LanguageVersion.CSharp6); 941await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForPropertiesAnalyzerTests.cs (4)
25private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 522await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 557await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationTests.cs (44)
35LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp8, 57LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 78LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 99LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 120LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 135LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 162LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 177LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 192LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 213LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 240LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 262LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 297LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 324LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 345LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 366LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 387LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 408LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 429LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 444LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 465LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 486LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 501LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 517LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 536LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 559LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 582LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 607LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 642LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 665LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 688LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 717LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 732LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 756LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 781LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 806LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 831LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 848LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 865LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 890LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 915LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 932LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 949LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 974LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
3367""", new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), options: ImplicitTypeEverywhere()));
src\Analyzers\CSharp\Tests\UseIndexOrRangeOperator\UseIndexOperatorTests.cs (3)
41LanguageVersion = LanguageVersion.CSharp7, 533LanguageVersion = LanguageVersion.CSharp8, 570LanguageVersion = LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\UseIndexOrRangeOperator\UseRangeOperatorTests.cs (4)
41LanguageVersion = LanguageVersion.CSharp7, 100LanguageVersion = LanguageVersion.CSharp8, 137LanguageVersion = LanguageVersion.CSharp8, 400LanguageVersion = LanguageVersion.CSharp7,
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\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (6)
49""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 64""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 88""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 114""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 129""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 144""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp8)));
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\UseIsNullCheck\UseNullCheckOverTypeCheckDiagnosticAnalyzerTests.cs (3)
20private static async Task VerifyAsync(string source, string fixedSource, LanguageVersion languageVersion) 31=> await VerifyAsync(source, fixedSource, LanguageVersion.CSharp9); 34=> await VerifyAsync(source, fixedSource, LanguageVersion.CSharp8);
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\UseNullPropagation\UseNullPropagationTests.cs (5)
33LanguageVersion = LanguageVersion.CSharp9, 41private static async Task TestMissingInRegularAndScriptAsync(string testCode, LanguageVersion languageVersion = LanguageVersion.CSharp9) 298""", LanguageVersion.CSharp5); 316""", LanguageVersion.CSharp5);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (28)
25LanguageVersion? languageVersion = null) 77LanguageVersion = LanguageVersion.CSharp12, 184LanguageVersion = LanguageVersion.CSharp12, 249LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 358LanguageVersion = LanguageVersion.CSharp12, 405LanguageVersion = LanguageVersion.CSharp12, 452LanguageVersion = LanguageVersion.CSharp12, 498LanguageVersion = LanguageVersion.CSharp12, 547LanguageVersion = LanguageVersion.CSharp12, 598LanguageVersion = LanguageVersion.CSharp12, 618""", LanguageVersion.CSharp2); 679LanguageVersion = LanguageVersion.CSharp12, 735LanguageVersion = LanguageVersion.CSharp12, 792LanguageVersion = LanguageVersion.CSharp12, 837LanguageVersion = LanguageVersion.CSharp12, 889LanguageVersion = LanguageVersion.CSharp12, 990LanguageVersion = LanguageVersion.CSharp12, 1043LanguageVersion = LanguageVersion.CSharp12, 1155LanguageVersion = LanguageVersion.CSharp12, 1220LanguageVersion = LanguageVersion.CSharp12, 1257LanguageVersion = LanguageVersion.CSharp12, 1339LanguageVersion = LanguageVersion.CSharp12, 1412LanguageVersion = LanguageVersion.CSharp12, 1455LanguageVersion = LanguageVersion.CSharp12, 1502LanguageVersion = LanguageVersion.CSharp12, 1545LanguageVersion = LanguageVersion.CSharp12, 1592LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndMemberAccessTests.cs (34)
70LanguageVersion = LanguageVersion.CSharp7, 91LanguageVersion = LanguageVersion.CSharp7, 110LanguageVersion = LanguageVersion.CSharp7, 134LanguageVersion = LanguageVersion.CSharp7, 155LanguageVersion = LanguageVersion.CSharp8, 176LanguageVersion = LanguageVersion.CSharp9, 197LanguageVersion = LanguageVersion.CSharp8, 218LanguageVersion = LanguageVersion.CSharp9, 242LanguageVersion = LanguageVersion.CSharp9, 265LanguageVersion = LanguageVersion.CSharp8, 300LanguageVersion = LanguageVersion.CSharp9, 337LanguageVersion = LanguageVersion.CSharp10, 360LanguageVersion = LanguageVersion.CSharp8, 383LanguageVersion = LanguageVersion.CSharp8, 420LanguageVersion = LanguageVersion.CSharp10, 451LanguageVersion = LanguageVersion.CSharp9, 482LanguageVersion = LanguageVersion.CSharp9, 517LanguageVersion = LanguageVersion.CSharp9, 548LanguageVersion = LanguageVersion.CSharp9, 599LanguageVersion = LanguageVersion.CSharp9, 620LanguageVersion = LanguageVersion.CSharp9, 641LanguageVersion = LanguageVersion.CSharp9, 665LanguageVersion = LanguageVersion.CSharp9, 700LanguageVersion = LanguageVersion.CSharp9, 737LanguageVersion = LanguageVersion.CSharp10, 772LanguageVersion = LanguageVersion.CSharp9, 809LanguageVersion = LanguageVersion.CSharp10, 834LanguageVersion = LanguageVersion.CSharp9, 871LanguageVersion = LanguageVersion.CSharp10, 984LanguageVersion = LanguageVersion.CSharp9, 1037LanguageVersion = LanguageVersion.CSharp9, 1134LanguageVersion = LanguageVersion.CSharp9, 1155LanguageVersion = LanguageVersion.CSharp9, 1228LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (14)
42[InlineData("x == null", "o is not string x", LanguageVersion.CSharp9)] 43public async Task InlineTypeCheck1(string input, string output, LanguageVersion version = LanguageVersion.CSharp8) 59private async Task TestStatement(string input, string output, LanguageVersion version = LanguageVersion.CSharp8) 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\UsePatternMatching\CSharpUseNotPatternTests.cs (16)
49LanguageVersion = LanguageVersion.CSharp9, 80LanguageVersion = LanguageVersion.CSharp9, 111LanguageVersion = LanguageVersion.CSharp9, 142LanguageVersion = LanguageVersion.CSharp9, 173LanguageVersion = LanguageVersion.CSharp9, 204LanguageVersion = LanguageVersion.CSharp9, 247LanguageVersion = LanguageVersion.CSharp9, 284LanguageVersion = LanguageVersion.CSharp9, 304LanguageVersion = LanguageVersion.CSharp8, 335LanguageVersion = LanguageVersion.CSharp9, 366LanguageVersion = LanguageVersion.CSharp9, 401LanguageVersion = LanguageVersion.CSharp9, 421LanguageVersion = LanguageVersion.CSharp9, 444LanguageVersion = LanguageVersion.CSharp9, 467LanguageVersion = LanguageVersion.CSharp9, 506LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UsePrimaryConstructor\UsePrimaryConstructorTests.cs (140)
40LanguageVersion = LanguageVersion.CSharp12, 57LanguageVersion = LanguageVersion.CSharp11, 74LanguageVersion = LanguageVersion.CSharp12, 96LanguageVersion = LanguageVersion.CSharp12, 117LanguageVersion = LanguageVersion.CSharp12, 146LanguageVersion = LanguageVersion.CSharp12, 183LanguageVersion = LanguageVersion.CSharp12, 220LanguageVersion = LanguageVersion.CSharp12, 259LanguageVersion = LanguageVersion.CSharp12, 298LanguageVersion = LanguageVersion.CSharp12, 339LanguageVersion = LanguageVersion.CSharp12, 355LanguageVersion = LanguageVersion.CSharp12, 373LanguageVersion = LanguageVersion.CSharp12, 397LanguageVersion = LanguageVersion.CSharp12, 421LanguageVersion = LanguageVersion.CSharp12, 445LanguageVersion = LanguageVersion.CSharp12, 469LanguageVersion = LanguageVersion.CSharp12, 490LanguageVersion = LanguageVersion.CSharp12, 511LanguageVersion = LanguageVersion.CSharp12, 529LanguageVersion = LanguageVersion.CSharp12, 550LanguageVersion = LanguageVersion.CSharp12, 574LanguageVersion = LanguageVersion.CSharp12, 603LanguageVersion = LanguageVersion.CSharp12, 630LanguageVersion = LanguageVersion.CSharp12, 658LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 715LanguageVersion = LanguageVersion.CSharp12, 738LanguageVersion = LanguageVersion.CSharp12, 793LanguageVersion = LanguageVersion.CSharp12, 832LanguageVersion = LanguageVersion.CSharp12, 871LanguageVersion = LanguageVersion.CSharp12, 910LanguageVersion = LanguageVersion.CSharp12, 951LanguageVersion = LanguageVersion.CSharp12, 994LanguageVersion = LanguageVersion.CSharp12, 1037LanguageVersion = LanguageVersion.CSharp12, 1059LanguageVersion = LanguageVersion.CSharp12, 1081LanguageVersion = LanguageVersion.CSharp12, 1111LanguageVersion = LanguageVersion.CSharp12, 1147LanguageVersion = LanguageVersion.CSharp12, 1187LanguageVersion = LanguageVersion.CSharp12, 1217LanguageVersion = LanguageVersion.CSharp12, 1265LanguageVersion = LanguageVersion.CSharp12, 1309LanguageVersion = LanguageVersion.CSharp12, 1349LanguageVersion = LanguageVersion.CSharp12, 1398LanguageVersion = LanguageVersion.CSharp12, 1445LanguageVersion = LanguageVersion.CSharp12, 1487LanguageVersion = LanguageVersion.CSharp12, 1529LanguageVersion = LanguageVersion.CSharp12, 1577LanguageVersion = LanguageVersion.CSharp12, 1625LanguageVersion = LanguageVersion.CSharp12, 1672LanguageVersion = LanguageVersion.CSharp12, 1721LanguageVersion = LanguageVersion.CSharp12, 1754LanguageVersion = LanguageVersion.CSharp12, 1786LanguageVersion = LanguageVersion.CSharp12, 1827LanguageVersion = LanguageVersion.CSharp12, 1886LanguageVersion = LanguageVersion.CSharp12, 1914LanguageVersion = LanguageVersion.CSharp12, 1942LanguageVersion = LanguageVersion.CSharp12, 1976LanguageVersion = LanguageVersion.CSharp12, 2012LanguageVersion = LanguageVersion.CSharp12, 2049LanguageVersion = LanguageVersion.CSharp12, 2088LanguageVersion = LanguageVersion.CSharp12, 2120LanguageVersion = LanguageVersion.CSharp12, 2155LanguageVersion = LanguageVersion.CSharp12, 2183LanguageVersion = LanguageVersion.CSharp12, 2217LanguageVersion = LanguageVersion.CSharp12, 2247LanguageVersion = LanguageVersion.CSharp12, 2283LanguageVersion = LanguageVersion.CSharp12, 2311LanguageVersion = LanguageVersion.CSharp12, 2345LanguageVersion = LanguageVersion.CSharp12, 2375LanguageVersion = LanguageVersion.CSharp12, 2411LanguageVersion = LanguageVersion.CSharp12, 2440LanguageVersion = LanguageVersion.CSharp12, 2473LanguageVersion = LanguageVersion.CSharp12, 2502LanguageVersion = LanguageVersion.CSharp12, 2535LanguageVersion = LanguageVersion.CSharp12, 2565LanguageVersion = LanguageVersion.CSharp12, 2586LanguageVersion = LanguageVersion.CSharp12, 2612LanguageVersion = LanguageVersion.CSharp12, 2638LanguageVersion = LanguageVersion.CSharp12, 2660LanguageVersion = LanguageVersion.CSharp12, 2682LanguageVersion = LanguageVersion.CSharp12, 2706LanguageVersion = LanguageVersion.CSharp12, 2730LanguageVersion = LanguageVersion.CSharp12, 2754LanguageVersion = LanguageVersion.CSharp12, 2778LanguageVersion = LanguageVersion.CSharp12, 2804LanguageVersion = LanguageVersion.CSharp12, 2830LanguageVersion = LanguageVersion.CSharp12, 2863LanguageVersion = LanguageVersion.CSharp12, 2904LanguageVersion = LanguageVersion.CSharp12, 2936LanguageVersion = LanguageVersion.CSharp12, 2968LanguageVersion = LanguageVersion.CSharp12, 2996LanguageVersion = LanguageVersion.CSharp12, 3024LanguageVersion = LanguageVersion.CSharp12, 3052LanguageVersion = LanguageVersion.CSharp12, 3129LanguageVersion = LanguageVersion.CSharp12, 3167LanguageVersion = LanguageVersion.CSharp12, 3212LanguageVersion = LanguageVersion.CSharp12, 3250LanguageVersion = LanguageVersion.CSharp12, 3292LanguageVersion = LanguageVersion.CSharp12, 3321LanguageVersion = LanguageVersion.CSharp12, 3343LanguageVersion = LanguageVersion.CSharp12, 3370LanguageVersion = LanguageVersion.CSharp12, 3391LanguageVersion = LanguageVersion.CSharp12, 3420LanguageVersion = LanguageVersion.CSharp12, 3442LanguageVersion = LanguageVersion.CSharp12, 3468LanguageVersion = LanguageVersion.CSharp12, 3497LanguageVersion = LanguageVersion.CSharp12, 3526LanguageVersion = LanguageVersion.CSharp12, 3555LanguageVersion = LanguageVersion.CSharp12, 3584LanguageVersion = LanguageVersion.CSharp12, 3606LanguageVersion = LanguageVersion.CSharp12, 3628LanguageVersion = LanguageVersion.CSharp12, 3645LanguageVersion = LanguageVersion.CSharp12, 3692LanguageVersion = LanguageVersion.CSharp12, 3728LanguageVersion = LanguageVersion.CSharp12, 3765LanguageVersion = LanguageVersion.CSharp12, 3791LanguageVersion = LanguageVersion.CSharp12, 3813LanguageVersion = LanguageVersion.CSharp12, 3839LanguageVersion = LanguageVersion.CSharp12, 3869LanguageVersion = LanguageVersion.CSharp12, 3912LanguageVersion = LanguageVersion.CSharp12, 3955LanguageVersion = LanguageVersion.CSharp12, 3998LanguageVersion = LanguageVersion.CSharp12, 4027LanguageVersion = LanguageVersion.CSharp12, 4070LanguageVersion = LanguageVersion.CSharp12, 4100LanguageVersion = LanguageVersion.CSharp12, 4126LanguageVersion = LanguageVersion.CSharp12, 4159LanguageVersion = LanguageVersion.CSharp12, 4188LanguageVersion = LanguageVersion.CSharp12, 4220LanguageVersion = LanguageVersion.CSharp12, 4249LanguageVersion = LanguageVersion.CSharp12, 4280LanguageVersion = LanguageVersion.CSharp12, 4308LanguageVersion = LanguageVersion.CSharp12, 4341LanguageVersion = LanguageVersion.CSharp12, 4371LanguageVersion = LanguageVersion.CSharp12, 4405LanguageVersion = LanguageVersion.CSharp12, 4436LanguageVersion = LanguageVersion.CSharp12, 4468LanguageVersion = LanguageVersion.CSharp12, 4503LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseSimpleUsingStatement\UseSimpleUsingStatementTests.cs (7)
142LanguageVersion = LanguageVersion.CSharp7_2 1944LanguageVersion = LanguageVersion.CSharp9, 1979LanguageVersion = LanguageVersion.CSharp9, 2005LanguageVersion = LanguageVersion.CSharp9, 2044LanguageVersion = LanguageVersion.CSharp9, 2079LanguageVersion = LanguageVersion.CSharp9, 2116LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseSystemThreadingLock\UseSystemThreadingLockTests.cs (45)
64LanguageVersion = LanguageVersion.CSharp13, 87LanguageVersion = LanguageVersion.CSharp12, 110LanguageVersion = LanguageVersion.CSharp12, 133LanguageVersion = LanguageVersion.CSharp12, 171LanguageVersion = LanguageVersion.CSharp13, 209LanguageVersion = LanguageVersion.CSharp13, 232LanguageVersion = LanguageVersion.CSharp13, 255LanguageVersion = LanguageVersion.CSharp13, 280LanguageVersion = LanguageVersion.CSharp13, 303LanguageVersion = LanguageVersion.CSharp13, 343LanguageVersion = LanguageVersion.CSharp13, 381LanguageVersion = LanguageVersion.CSharp13, 422LanguageVersion = LanguageVersion.CSharp13, 460LanguageVersion = LanguageVersion.CSharp13, 486LanguageVersion = LanguageVersion.CSharp13, 531LanguageVersion = LanguageVersion.CSharp13, 584LanguageVersion = LanguageVersion.CSharp13, 604LanguageVersion = LanguageVersion.CSharp13, 631LanguageVersion = LanguageVersion.CSharp13, 656LanguageVersion = LanguageVersion.CSharp13, 679LanguageVersion = LanguageVersion.CSharp13, 702LanguageVersion = LanguageVersion.CSharp13, 725LanguageVersion = LanguageVersion.CSharp13, 753LanguageVersion = LanguageVersion.CSharp13, 781LanguageVersion = LanguageVersion.CSharp13, 804LanguageVersion = LanguageVersion.CSharp13, 827LanguageVersion = LanguageVersion.CSharp13, 873LanguageVersion = LanguageVersion.CSharp13, 921LanguageVersion = LanguageVersion.CSharp13, 959LanguageVersion = LanguageVersion.CSharp13, 997LanguageVersion = LanguageVersion.CSharp13, 1035LanguageVersion = LanguageVersion.CSharp13, 1073LanguageVersion = LanguageVersion.CSharp13, 1121LanguageVersion = LanguageVersion.CSharp13, 1169LanguageVersion = LanguageVersion.CSharp13, 1217LanguageVersion = LanguageVersion.CSharp13, 1265LanguageVersion = LanguageVersion.CSharp13, 1321LanguageVersion = LanguageVersion.CSharp13, 1377LanguageVersion = LanguageVersion.CSharp13, 1417LanguageVersion = LanguageVersion.CSharp13, 1438LanguageVersion = LanguageVersion.CSharp13, 1478LanguageVersion = LanguageVersion.CSharp13, 1524LanguageVersion = LanguageVersion.CSharp13, 1568LanguageVersion = LanguageVersion.CSharp13, 1612LanguageVersion = LanguageVersion.CSharp13,
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));
src\Analyzers\CSharp\Tests\UseTupleSwap\UseTupleSwapTests.cs (2)
42LanguageVersion = LanguageVersion.CSharp6, 444LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseUnboundGenericTypeInNameOf\UseUnboundGenericTypeInNameOfTests.cs (1)
90LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseUtf8StringLiteral\UseUtf8StringLiteralTests.cs (49)
47LanguageVersion = LanguageVersion.CSharp12 66LanguageVersion = LanguageVersion.CSharp10 86LanguageVersion = LanguageVersion.CSharp12 106LanguageVersion = LanguageVersion.CSharp12 133LanguageVersion = LanguageVersion.CSharp12 153LanguageVersion = LanguageVersion.CSharp12 177LanguageVersion = LanguageVersion.CSharp12 199LanguageVersion = LanguageVersion.CSharp12 219LanguageVersion = LanguageVersion.CSharp12 250LanguageVersion = LanguageVersion.CSharp12 283LanguageVersion = LanguageVersion.CSharp12 314LanguageVersion = LanguageVersion.CSharp12 345LanguageVersion = LanguageVersion.CSharp12 376LanguageVersion = LanguageVersion.CSharp12 407LanguageVersion = LanguageVersion.CSharp12 437LanguageVersion = LanguageVersion.CSharp12 468LanguageVersion = LanguageVersion.CSharp12 499LanguageVersion = LanguageVersion.CSharp12 534LanguageVersion = LanguageVersion.CSharp12 565LanguageVersion = LanguageVersion.CSharp12 596LanguageVersion = LanguageVersion.CSharp12 617LanguageVersion = LanguageVersion.CSharp12 638LanguageVersion = LanguageVersion.CSharp12 659LanguageVersion = LanguageVersion.CSharp12 693LanguageVersion = LanguageVersion.CSharp12 774LanguageVersion = LanguageVersion.CSharp12 802LanguageVersion = LanguageVersion.CSharp12 835LanguageVersion = LanguageVersion.CSharp12 890LanguageVersion = LanguageVersion.CSharp12 921LanguageVersion = LanguageVersion.CSharp12 952LanguageVersion = LanguageVersion.CSharp12 983LanguageVersion = LanguageVersion.CSharp12 1014LanguageVersion = LanguageVersion.CSharp12 1045LanguageVersion = LanguageVersion.CSharp12 1076LanguageVersion = LanguageVersion.CSharp12 1096LanguageVersion = LanguageVersion.CSharp12 1127LanguageVersion = LanguageVersion.CSharp12 1158LanguageVersion = LanguageVersion.CSharp12 1189LanguageVersion = LanguageVersion.CSharp12 1220LanguageVersion = LanguageVersion.CSharp12 1251LanguageVersion = LanguageVersion.CSharp12 1292LanguageVersion = LanguageVersion.CSharp12 1347LanguageVersion = LanguageVersion.CSharp12 1436LanguageVersion = LanguageVersion.CSharp12 1467LanguageVersion = LanguageVersion.CSharp12 1498LanguageVersion = LanguageVersion.CSharp12 1529LanguageVersion = LanguageVersion.CSharp12 1564LanguageVersion = LanguageVersion.CSharp12 1599LanguageVersion = LanguageVersion.CSharp12
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (142)
CommandLineTests.cs (142)
1585[InlineData("iso-1", LanguageVersion.CSharp1)] 1586[InlineData("iso-2", LanguageVersion.CSharp2)] 1587[InlineData("1", LanguageVersion.CSharp1)] 1588[InlineData("1.0", LanguageVersion.CSharp1)] 1589[InlineData("2", LanguageVersion.CSharp2)] 1590[InlineData("2.0", LanguageVersion.CSharp2)] 1591[InlineData("3", LanguageVersion.CSharp3)] 1592[InlineData("3.0", LanguageVersion.CSharp3)] 1593[InlineData("4", LanguageVersion.CSharp4)] 1594[InlineData("4.0", LanguageVersion.CSharp4)] 1595[InlineData("5", LanguageVersion.CSharp5)] 1596[InlineData("5.0", LanguageVersion.CSharp5)] 1597[InlineData("6", LanguageVersion.CSharp6)] 1598[InlineData("6.0", LanguageVersion.CSharp6)] 1599[InlineData("7", LanguageVersion.CSharp7)] 1600[InlineData("7.0", LanguageVersion.CSharp7)] 1601[InlineData("7.1", LanguageVersion.CSharp7_1)] 1602[InlineData("7.2", LanguageVersion.CSharp7_2)] 1603[InlineData("7.3", LanguageVersion.CSharp7_3)] 1604[InlineData("8", LanguageVersion.CSharp8)] 1605[InlineData("8.0", LanguageVersion.CSharp8)] 1606[InlineData("9", LanguageVersion.CSharp9)] 1607[InlineData("9.0", LanguageVersion.CSharp9)] 1608[InlineData("preview", LanguageVersion.Preview)] 1609public void LangVersion_CanParseCorrectVersions(string value, LanguageVersion expectedVersion) 1623[InlineData("6", "7", LanguageVersion.CSharp7)] 1624[InlineData("7", "6", LanguageVersion.CSharp6)] 1625[InlineData("7", "1", LanguageVersion.CSharp1)] 1626[InlineData("6", "iso-1", LanguageVersion.CSharp1)] 1627[InlineData("6", "iso-2", LanguageVersion.CSharp2)] 1628[InlineData("6", "default", LanguageVersion.Default)] 1629[InlineData("7", "default", LanguageVersion.Default)] 1630[InlineData("iso-2", "6", LanguageVersion.CSharp6)] 1631public void LangVersion_LatterVersionOverridesFormerOne(string formerValue, string latterValue, LanguageVersion expectedVersion) 1641LanguageVersion defaultEffectiveVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion(); 1642Assert.NotEqual(LanguageVersion.Default, defaultEffectiveVersion); 1647Assert.Equal(LanguageVersion.Default, parsedArgs.ParseOptions.SpecifiedLanguageVersion); 1654LanguageVersion latestEffectiveVersion = LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(); 1655Assert.NotEqual(LanguageVersion.Latest, latestEffectiveVersion); 1660Assert.Equal(LanguageVersion.Latest, parsedArgs.ParseOptions.SpecifiedLanguageVersion); 1669Assert.Equal(LanguageVersion.Default, parsedArgs.ParseOptions.SpecifiedLanguageVersion); 1734Enum.GetValues(typeof(LanguageVersion)).Cast<LanguageVersion>().Select(v => v.ToDisplayString())); 1741var versions = Enum.GetValues(typeof(LanguageVersion)) 1742.Cast<LanguageVersion>() 1744LanguageVersion.Default, 1745LanguageVersion.Latest, 1746LanguageVersion.LatestMajor, 1747LanguageVersion.Preview 1778InlineData(LanguageVersion.CSharp1, LanguageVersion.CSharp1), 1779InlineData(LanguageVersion.CSharp2, LanguageVersion.CSharp2), 1780InlineData(LanguageVersion.CSharp3, LanguageVersion.CSharp3), 1781InlineData(LanguageVersion.CSharp4, LanguageVersion.CSharp4), 1782InlineData(LanguageVersion.CSharp5, LanguageVersion.CSharp5), 1783InlineData(LanguageVersion.CSharp6, LanguageVersion.CSharp6), 1784InlineData(LanguageVersion.CSharp7, LanguageVersion.CSharp7), 1785InlineData(LanguageVersion.CSharp7_1, LanguageVersion.CSharp7_1), 1786InlineData(LanguageVersion.CSharp7_2, LanguageVersion.CSharp7_2), 1787InlineData(LanguageVersion.CSharp7_3, LanguageVersion.CSharp7_3), 1788InlineData(LanguageVersion.CSharp8, LanguageVersion.CSharp8), 1789InlineData(LanguageVersion.CSharp9, LanguageVersion.CSharp9), 1790InlineData(LanguageVersion.CSharp10, LanguageVersion.CSharp10), 1791InlineData(LanguageVersion.CSharp11, LanguageVersion.CSharp11), 1792InlineData(LanguageVersion.CSharp12, LanguageVersion.CSharp12), 1793InlineData(LanguageVersion.CSharp13, LanguageVersion.CSharp13), 1794InlineData(LanguageVersion.CSharp13, LanguageVersion.LatestMajor), 1795InlineData(LanguageVersion.CSharp13, LanguageVersion.Latest), 1796InlineData(LanguageVersion.CSharp13, LanguageVersion.Default), 1797InlineData(LanguageVersion.Preview, LanguageVersion.Preview), 1799public void LanguageVersion_MapSpecifiedToEffectiveVersion(LanguageVersion expectedMappedVersion, LanguageVersion input) 1809InlineData("iso-1", true, LanguageVersion.CSharp1), 1810InlineData("ISO-1", true, LanguageVersion.CSharp1), 1811InlineData("iso-2", true, LanguageVersion.CSharp2), 1812InlineData("1", true, LanguageVersion.CSharp1), 1813InlineData("1.0", true, LanguageVersion.CSharp1), 1814InlineData("2", true, LanguageVersion.CSharp2), 1815InlineData("2.0", true, LanguageVersion.CSharp2), 1816InlineData("3", true, LanguageVersion.CSharp3), 1817InlineData("3.0", true, LanguageVersion.CSharp3), 1818InlineData("4", true, LanguageVersion.CSharp4), 1819InlineData("4.0", true, LanguageVersion.CSharp4), 1820InlineData("5", true, LanguageVersion.CSharp5), 1821InlineData("5.0", true, LanguageVersion.CSharp5), 1822InlineData("05", false, LanguageVersion.Default), 1823InlineData("6", true, LanguageVersion.CSharp6), 1824InlineData("6.0", true, LanguageVersion.CSharp6), 1825InlineData("7", true, LanguageVersion.CSharp7), 1826InlineData("7.0", true, LanguageVersion.CSharp7), 1827InlineData("07", false, LanguageVersion.Default), 1828InlineData("7.1", true, LanguageVersion.CSharp7_1), 1829InlineData("7.2", true, LanguageVersion.CSharp7_2), 1830InlineData("7.3", true, LanguageVersion.CSharp7_3), 1831InlineData("8", true, LanguageVersion.CSharp8), 1832InlineData("8.0", true, LanguageVersion.CSharp8), 1833InlineData("9", true, LanguageVersion.CSharp9), 1834InlineData("9.0", true, LanguageVersion.CSharp9), 1835InlineData("10", true, LanguageVersion.CSharp10), 1836InlineData("10.0", true, LanguageVersion.CSharp10), 1837InlineData("11", true, LanguageVersion.CSharp11), 1838InlineData("11.0", true, LanguageVersion.CSharp11), 1839InlineData("12", true, LanguageVersion.CSharp12), 1840InlineData("12.0", true, LanguageVersion.CSharp12), 1841InlineData("13", true, LanguageVersion.CSharp13), 1842InlineData("13.0", true, LanguageVersion.CSharp13), 1843InlineData("08", false, LanguageVersion.Default), 1844InlineData("07.1", false, LanguageVersion.Default), 1845InlineData("default", true, LanguageVersion.Default), 1846InlineData("latest", true, LanguageVersion.Latest), 1847InlineData("latestmajor", true, LanguageVersion.LatestMajor), 1848InlineData("preview", true, LanguageVersion.Preview), 1849InlineData("latestpreview", false, LanguageVersion.Default), 1850InlineData(null, true, LanguageVersion.Default), 1851InlineData("bad", false, LanguageVersion.Default)] 1852public void LanguageVersion_TryParseDisplayString(string input, bool success, LanguageVersion expected) 1854Assert.Equal(success, LanguageVersionFacts.TryParse(input, out var version)); 1866Assert.True(LanguageVersionFacts.TryParse("ISO-1", out var version)); 1867Assert.Equal(LanguageVersion.CSharp1, version); 1880var expected = Enum.GetValues(typeof(LanguageVersion)).Cast<LanguageVersion>()
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
ConvertNamespace\ConvertNamespaceCommandHandler.cs (1)
141if (!ConvertNamespaceAnalysis.CanOfferUseFileScoped(s_fileScopedNamespacePreferenceOption, (CompilationUnitSyntax)parsedDocument.Root, namespaceDecl, forAnalyzer: true, LanguageVersion.CSharp10))
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
24new(languageVersion: LanguageVersion.Latest, kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (179)
ChangeSignature\ChangeSignature_CheckAllSignatureChanges.cs (1)
182parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
Classification\SyntacticClassifierTests.cs (1)
3094[new CSharpParseOptions(LanguageVersion.CSharp8)],
CodeActions\GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersTests.cs (64)
111LanguageVersion = LanguageVersion.CSharp6, 148LanguageVersion = LanguageVersion.CSharp7, 186LanguageVersion = LanguageVersion.CSharp6, 230LanguageVersion = LanguageVersion.CSharp6, 326LanguageVersion = LanguageVersion.CSharp6, 364LanguageVersion = LanguageVersion.CSharp6, 402LanguageVersion = LanguageVersion.CSharp6, 445LanguageVersion = LanguageVersion.CSharp6, 487LanguageVersion = LanguageVersion.CSharp6, 548LanguageVersion = LanguageVersion.CSharp6, 616LanguageVersion = LanguageVersion.CSharp6, 878LanguageVersion = LanguageVersion.CSharp6, 950LanguageVersion = LanguageVersion.CSharp6, 994LanguageVersion = LanguageVersion.CSharp6, 1049LanguageVersion = LanguageVersion.CSharp6, 1102LanguageVersion = LanguageVersion.CSharp6, 1147LanguageVersion = LanguageVersion.CSharp6, 1190LanguageVersion = LanguageVersion.CSharp6, 1234LanguageVersion = LanguageVersion.CSharp6, 1286LanguageVersion = LanguageVersion.CSharp6, 1494LanguageVersion = LanguageVersion.CSharp6, 1532LanguageVersion = LanguageVersion.CSharp6, 1570LanguageVersion = LanguageVersion.CSharp6, 1614LanguageVersion = LanguageVersion.CSharp6, 1658LanguageVersion = LanguageVersion.CSharp6, 1710LanguageVersion = LanguageVersion.CSharp6, 1764LanguageVersion = LanguageVersion.CSharp6, 1816LanguageVersion = LanguageVersion.CSharp6, 1860LanguageVersion = LanguageVersion.CSharp6, 1904LanguageVersion = LanguageVersion.CSharp6, 1956LanguageVersion = LanguageVersion.CSharp6, 2000LanguageVersion = LanguageVersion.CSharp6, 2043LanguageVersion = LanguageVersion.CSharp6, 2088LanguageVersion = LanguageVersion.CSharp6, 2131LanguageVersion = LanguageVersion.CSharp6, 2166LanguageVersion = LanguageVersion.CSharp6, 2339LanguageVersion = LanguageVersion.CSharp6, 2383LanguageVersion = LanguageVersion.CSharp6, 2431LanguageVersion = LanguageVersion.CSharp6, 2486LanguageVersion = LanguageVersion.CSharp6, 2544LanguageVersion = LanguageVersion.CSharp6, 2618LanguageVersion = LanguageVersion.CSharp6, 2663LanguageVersion = LanguageVersion.CSharp6, 2776LanguageVersion = LanguageVersion.CSharp8, 2825LanguageVersion = LanguageVersion.CSharp8, 2870LanguageVersion = LanguageVersion.CSharp6, 2916LanguageVersion = LanguageVersion.CSharp7, 2962LanguageVersion = LanguageVersion.CSharp8, 3008LanguageVersion = LanguageVersion.CSharp9, 3055LanguageVersion = LanguageVersion.CSharp8, 3105LanguageVersion = LanguageVersion.CSharp8, 3145LanguageVersion = LanguageVersion.CSharp6, 3155LanguageVersion = LanguageVersion.CSharp6, 3308LanguageVersion = LanguageVersion.CSharp6, 3373LanguageVersion = LanguageVersion.CSharp6, 3441LanguageVersion = LanguageVersion.CSharp6, 3520LanguageVersion = LanguageVersion.CSharp6, 3591LanguageVersion = LanguageVersion.CSharp6, 3666LanguageVersion = LanguageVersion.CSharp6, 3744LanguageVersion = LanguageVersion.CSharp6, 3822LanguageVersion = LanguageVersion.CSharp6, 4038LanguageVersion = LanguageVersion.Default, 4095LanguageVersion = LanguageVersion.Default, 4400LanguageVersion = LanguageVersion.Default,
CodeActions\GenerateType\GenerateTypeTests.cs (1)
5592parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10),
CodeActions\InitializeParameter\AddParameterCheckTests.cs (21)
51LanguageVersion = LanguageVersion.CSharp11, 91LanguageVersion = LanguageVersion.CSharp6, 244[InlineData(LanguageVersion.CSharp11)] 245[InlineData(LanguageVersion.CSharp8)] 246public async Task TestNotOnPartialMethodDefinition1(LanguageVersion languageVersion) 284LanguageVersion = LanguageVersion.CSharp9, 290[InlineData(LanguageVersion.CSharp11)] 291[InlineData(LanguageVersion.CSharp8)] 292public async Task TestNotOnPartialMethodDefinition2(LanguageVersion languageVersion) 330LanguageVersion = LanguageVersion.CSharp9, 374LanguageVersion = LanguageVersion.CSharp9, 445LanguageVersion = LanguageVersion.CSharp9, 893LanguageVersion = LanguageVersion.CSharp6, 1664LanguageVersion = LanguageVersion.CSharp11, 1714LanguageVersion = LanguageVersion.CSharp11, 1828LanguageVersion = LanguageVersion.CSharp11, 2918[InlineData(LanguageVersion.CSharp10)] 2919[InlineData(LanguageVersion.CSharp11)] 2920public async Task TestNotInRecord(LanguageVersion version) 2940LanguageVersion = LanguageVersion.CSharp12, 2953LanguageVersion = LanguageVersion.CSharp12,
CodeActions\InlineMethod\CSharpInlineMethodTests.cs (2)
54LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 79LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9,
CodeActions\MoveStaticMembers\CSharpMoveStaticMembersTests.cs (4)
685LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10 3387LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10, 3407LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10, 3430LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10,
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (1)
32protected static string GetMarkup(string source, LanguageVersion languageVersion)
Completion\CompletionProviders\AwaitCompletionProviderTests.cs (26)
37[StringSyntax(PredefinedEmbeddedLanguageNames.CSharpTest)] string code, LanguageVersion languageVersion = LanguageVersion.Default) 44[StringSyntax(PredefinedEmbeddedLanguageNames.CSharpTest)] string code, LanguageVersion languageVersion = LanguageVersion.Default, string? inlineDescription = null, bool dotAwait = false, bool dotAwaitf = false) 86""", LanguageVersion.CSharp9); 99""", LanguageVersion.CSharp9); 105await VerifyKeywordAsync("$$", LanguageVersion.CSharp9); 118""", LanguageVersion.CSharp9); 131""", LanguageVersion.CSharp9); 137await VerifyKeywordAsync("var z = $$", LanguageVersion.CSharp9); 150""", LanguageVersion.CSharp9); 156await VerifyAbsenceAsync("using $$", LanguageVersion.CSharp9); 177""", LanguageVersion.CSharp9); 183await VerifyAbsenceAsync("foreach $$", LanguageVersion.CSharp9); 197""", LanguageVersion.CSharp9); 207""", LanguageVersion.CSharp9); 221""", LanguageVersion.CSharp9); 231""", LanguageVersion.CSharp9); 245""", LanguageVersion.CSharp9); 255""", LanguageVersion.CSharp9); 268""", LanguageVersion.CSharp9); 274await VerifyAbsenceAsync("lock (this) { $$ }", LanguageVersion.CSharp9); 288""", LanguageVersion.CSharp9); 298""", LanguageVersion.CSharp9); 311""", LanguageVersion.CSharp9); 317await VerifyKeywordAsync("lock($$", LanguageVersion.CSharp9);
Completion\CompletionProviders\DeclarationNameCompletionProviderTests.cs (24)
610[InlineData(LanguageVersion.CSharp7)] 611[InlineData(LanguageVersion.CSharp8)] 612[InlineData(LanguageVersion.Latest)] 615public async Task Parameter10(LanguageVersion languageVersion) 630if (languageVersion.MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 640[InlineData(LanguageVersion.CSharp7)] 641[InlineData(LanguageVersion.CSharp8)] 642[InlineData(LanguageVersion.Latest)] 645public async Task Parameter11(LanguageVersion languageVersion) 661if (languageVersion.MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 671[InlineData(LanguageVersion.CSharp7)] 672[InlineData(LanguageVersion.CSharp8)] 673[InlineData(LanguageVersion.Latest)] 676public async Task Parameter12(LanguageVersion languageVersion) 692if (languageVersion.MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 2596[InlineData(LanguageVersion.CSharp7)] 2597[InlineData(LanguageVersion.CSharp8)] 2598[InlineData(LanguageVersion.Latest)] 2601public async Task TestUseLocalAsLocalFunctionParameter(LanguageVersion languageVersion) 2616if (languageVersion.MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 2627[InlineData(LanguageVersion.CSharp7)] 2628[InlineData(LanguageVersion.CSharp8)] 2629[InlineData(LanguageVersion.Latest)] 2632public async Task TestCompletionDoesNotUseLocalAsLocalFunctionVariable(LanguageVersion languageVersion)
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\CSharpNewDocumentFormattingServiceTests.cs (3)
58parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 81parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 103parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9));
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),
QuickInfo\SemanticQuickInfoSourceTests.cs (15)
3248Options.Regular.WithLanguageVersion(LanguageVersion.CSharp8), 3288Options.Regular.WithLanguageVersion(LanguageVersion.CSharp8), 8740Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8755Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8876Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8891Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8906Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8921Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 8940Options.Regular.WithLanguageVersion(LanguageVersion.Preview), 9312Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 9326Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 9341Options.Regular.WithLanguageVersion(LanguageVersion.CSharp9), 9899await TestWithOptionsAsync(Options.Regular.WithLanguageVersion(LanguageVersion.CSharp11), source, 9914await TestWithOptionsAsync(Options.Regular.WithLanguageVersion(LanguageVersion.CSharp11), source, 9933await TestWithOptionsAsync(Options.Regular.WithLanguageVersion(LanguageVersion.CSharp11), source,
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 (109)
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 (6)
8073[InlineData("in", LanguageVersion.CSharp9)] 8074[InlineData("ref readonly", LanguageVersion.Preview)] 8075public void TestGetAsyncEnumeratorPatternViaInExtensionOnNonAssignableVariable(string modifier, LanguageVersion languageVersion) 8105[InlineData("in", LanguageVersion.CSharp9)] 8106[InlineData("ref readonly", LanguageVersion.Preview)] 8107public void TestGetAsyncEnumeratorPatternViaInExtensionOnAssignableVariable(string modifier, LanguageVersion 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 (9)
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 (4)
353languageVersion: LanguageVersion.CSharp8, 357yield return parseOptions.WithLanguageVersion(LanguageVersion.CSharp9); 358yield return parseOptions.WithLanguageVersion(LanguageVersion.Latest); 359yield return parseOptions.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (218)
Attributes\AttributeTests_Dynamic.cs (6)
911parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview), 1299parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2))); 1309parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2)); 1351parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2))); 1365parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.Preview))); 1394CreateCompilationWithMscorlib461(source: source, parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2)).VerifyDiagnostics(
Attributes\AttributeTests_RefSafetyRules.cs (11)
82[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 164[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 165[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 173bool useUpdatedEscapeRulesA = languageVersionA == LanguageVersion.CSharp11; 182Assert.Equal(languageVersionB == LanguageVersion.CSharp11, comp.SourceModule.UseUpdatedEscapeRules);
Attributes\AttributeTests_WellKnownAttributes.cs (4)
13662CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13679CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13705CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13731CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
Diagnostics\GetDiagnosticsTests.cs (2)
409var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000)); 481var parseOptions = new CSharpParseOptions(LanguageVersion.Latest);
FieldKeywordTests.cs (47)
657[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 686if (languageVersion == LanguageVersion.CSharp13) 827[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 846if (languageVersion == LanguageVersion.CSharp13) 928Assert.Equal(languageVersion > LanguageVersion.CSharp13, ((SourcePropertySymbol)actualProperties[0]).UsesFieldKeyword); 929Assert.Equal(languageVersion > LanguageVersion.CSharp13, ((SourcePropertySymbol)actualProperties[1]).UsesFieldKeyword); 937[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, bool useInit) 955if (languageVersion == LanguageVersion.CSharp13) 1029Assert.Equal(languageVersion > LanguageVersion.CSharp13, ((SourcePropertySymbol)actualProperties[0]).UsesFieldKeyword); 1030Assert.Equal(languageVersion > LanguageVersion.CSharp13, ((SourcePropertySymbol)actualProperties[1]).UsesFieldKeyword); 1039[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 1069if (languageVersion == LanguageVersion.CSharp13) 1136[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 1166if (languageVersion == LanguageVersion.CSharp13) 1455[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 8333[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 8366if (languageVersion == LanguageVersion.CSharp13) 8485[CombinatorialValues(LanguageVersion.CSharp12, LanguageVersion.CSharp13)] LanguageVersion languageVersion, 8512case (LanguageVersion.CSharp12, false): 8533case (LanguageVersion.CSharp12, true): 8548case (LanguageVersion.CSharp13, false): 8557case (LanguageVersion.CSharp13, true): 8575[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 8597if (languageVersion == LanguageVersion.CSharp13) 8650[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 8672if (languageVersion == LanguageVersion.CSharp13) 10177[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 10203if (languageVersion == LanguageVersion.CSharp13) 10281[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 10306if (languageVersion == LanguageVersion.CSharp13) 10348if (languageVersion == LanguageVersion.CSharp13) 10363if (languageVersion == LanguageVersion.CSharp13) 10378[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion)
FirstClassSpanTests.cs (99)
21public static TheoryData<LanguageVersion> LangVersions() 23return new TheoryData<LanguageVersion>() 25LanguageVersion.CSharp13, 27LanguageVersion.Preview, 206public void BreakingChange_ExtensionMethodLookup_SpanVsIEnumerable_Workaround(LanguageVersion langVersion) 242public void BreakingChange_ExtensionMethodLookup_SpanVsIEnumerable_MethodConversion(LanguageVersion langVersion) 263public void BreakingChange_ExtensionMethodLookup_SpanVsIEnumerable_MethodConversion_Workaround(LanguageVersion langVersion) 321[CombinatorialLangVersions] LanguageVersion langVersion, 375public void BreakingChange_TypeInference_SpanVsIEnumerable_02_Workaround_AsEnumerable(LanguageVersion langVersion) 615public void BreakingChange_Conversion_SpanVsArray_Workaround_AsSpan(LanguageVersion langVersion) 729[CombinatorialLangVersions] LanguageVersion langVersion, 760[CombinatorialLangVersions] LanguageVersion langVersion, 788[CombinatorialLangVersions] LanguageVersion langVersion, 821[CombinatorialLangVersions] LanguageVersion langVersion, 903[CombinatorialLangVersions] LanguageVersion langVersion, 984[CombinatorialLangVersions] LanguageVersion langVersion, 1062public void Conversion_Array_Span_Implicit_IsOperator(LanguageVersion langVersion) 1089public void Conversion_Array_Span_Implicit_IsPattern(LanguageVersion langVersion) 1106public void Conversion_Array_Span_Implicit_SwitchPattern(LanguageVersion langVersion) 1125public void Conversion_Array_Span_Explicit_IsOperator(LanguageVersion langVersion) 1152public void Conversion_Array_Span_Explicit_IsPattern(LanguageVersion langVersion) 1169public void Conversion_Array_Span_Explicit_SwitchPattern(LanguageVersion langVersion) 1188public void Conversion_string_ReadOnlySpan_Implicit_IsOperator(LanguageVersion langVersion) 1215public void Conversion_string_ReadOnlySpan_Implicit_IsPattern(LanguageVersion langVersion) 1232public void Conversion_string_ReadOnlySpan_Implicit_SwitchPattern(LanguageVersion langVersion) 1910public void Conversion_Array_Span_Implicit_ConstantData(LanguageVersion langVersion) 1982public void Conversion_Array_Span_Implicit_ConstantData_NotWellKnownSpan(LanguageVersion langVersion) 2894public void Conversion_Array_Span_Implicit_UnrelatedElementType(LanguageVersion langVersion) 2909public void Conversion_Array_Span_Explicit_UnrelatedElementType(LanguageVersion langVersion) 2925public void Conversion_Array_ReadOnlySpan_Implicit_UnrelatedElementType(LanguageVersion langVersion) 2940public void Conversion_Span_Array_Implicit_UserDefined(LanguageVersion langVersion) 2970public void Conversion_Array_ReadOnlySpan_Explicit_UnrelatedElementType(LanguageVersion langVersion) 2986public void Conversion_Span_ReadOnlySpan_Implicit_UnrelatedElementType(LanguageVersion langVersion) 3002public void Conversion_Span_ReadOnlySpan_Explicit_UnrelatedElementType(LanguageVersion langVersion) 3018public void Conversion_Span_ReadOnlySpan_Implicit_Struct(LanguageVersion langVersion) 3031public void Conversion_Span_ReadOnlySpan_Implicit_Struct_Generic(LanguageVersion langVersion) 3048public void Conversion_Span_ReadOnlySpan_Implicit_Struct_Generic_NullabilityAnnotation(LanguageVersion langVersion) 3059var targetType = langVersion > LanguageVersion.CSharp13 ? "System.Span<S<string>>" : "System.ReadOnlySpan<S<string>>"; 3067public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_UnrelatedElementType(LanguageVersion langVersion) 3083public void Conversion_ReadOnlySpan_ReadOnlySpan_Explicit_UnrelatedElementType(LanguageVersion langVersion) 3099public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_Struct(LanguageVersion langVersion) 3112public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_Struct_Generic(LanguageVersion langVersion) 3129public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_Struct_Generic_NullabilityAnnotation(LanguageVersion langVersion) 3147public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_UserDefined_01(LanguageVersion langVersion) 3225[CombinatorialLangVersions] LanguageVersion langVersion, 3243[CombinatorialLangVersions] LanguageVersion langVersion, 3260public void Conversion_ReadOnlySpan_Span_Implicit_UserDefined(LanguageVersion langVersion) 3291public void Conversion_ReadOnlySpan_Span_Explicit_UserDefined(LanguageVersion langVersion) 3322public void Conversion_ReadOnlySpan_Span_Explicit_UserDefined_Covariant(LanguageVersion langVersion) 3353public void Conversion_string_ReadOnlySpan_Implicit_UnrelatedElementType(LanguageVersion langVersion) 3374public void Conversion_string_Span_Implicit(LanguageVersion langVersion) 3390public void Conversion_string_Span_Explicit(LanguageVersion langVersion) 3406public void Conversion_string_Span_Implicit_UserDefined(LanguageVersion langVersion) 3436public void Conversion_ReadOnlySpan_string_Implicit_UserDefined(LanguageVersion langVersion) 3712public void Conversion_string_ReadOnlySpan_Implicit_NullableAnalysis(LanguageVersion langVersion) 3819public void Conversion_Array_Span_Implicit_NullableAnalysis_NestedNullability(LanguageVersion langVersion) 3847=> langVersion > LanguageVersion.CSharp13 ? $"System.Span<S<{inner}>>" : $"S<{inner}>[]"; 3851public void Conversion_Array_ReadOnlySpan_Implicit_NullableAnalysis_NestedNullability(LanguageVersion langVersion) 3887=> langVersion > LanguageVersion.CSharp13 ? $"System.ReadOnlySpan<S<{inner}>>" : $"S<{inner}>[]"; 3947public void Conversion_ReadOnlySpan_ReadOnlySpan_Implicit_NullableAnalysis_NestedNullability(LanguageVersion langVersion) 3984public void Conversion_Array_ReadOnlySpan_Implicit_NullableAnalysis_NestedNullability_Covariant(LanguageVersion langVersion) 3995var targetType = langVersion > LanguageVersion.CSharp13 ? "System.ReadOnlySpan<I<object>>" : "I<object>[]"; 4032public void Conversion_Array_Span_Implicit_NullableAnalysis_Outer(LanguageVersion langVersion) 4187[CombinatorialLangVersions] LanguageVersion langVersion, 4261public void Conversion_Array_Span_Implicit_RefReturn(LanguageVersion langVersion) 4321public void Conversion_Array_Span_Opposite_Implicit(LanguageVersion langVersion) 4348public void Conversion_Span_ReadOnlySpan_Opposite_Implicit(LanguageVersion langVersion) 4364public void Conversion_ReadOnlySpan_ReadOnlySpan_Opposite_Implicit(LanguageVersion langVersion) 4380public void Conversion_string_ReadOnlySpan_Opposite_Implicit(LanguageVersion langVersion) 4396public void Conversion_Array_Span_Opposite_Explicit(LanguageVersion langVersion) 4423public void Conversion_Span_ReadOnlySpan_Opposite_Explicit(LanguageVersion langVersion) 4439public void Conversion_ReadOnlySpan_ReadOnlySpan_Opposite_Explicit(LanguageVersion langVersion) 4455public void Conversion_string_ReadOnlySpan_Opposite_Explicit(LanguageVersion langVersion) 4471public void Conversion_Array_Span_Opposite_Explicit_UserDefined(LanguageVersion langVersion) 4501public void Conversion_Span_ReadOnlySpan_Opposite_Explicit_UserDefined(LanguageVersion langVersion) 4533public void Conversion_string_ReadOnlySpan_Opposite_Explicit_UserDefined(LanguageVersion langVersion) 4564public void Conversion_Array_Span_Implicit_Params(LanguageVersion langVersion) 4690public void Conversion_Span_ReadOnlySpan_Implicit_Params(LanguageVersion langVersion) 4840public void Conversion_Array_Span_Implicit_Multidimensional(LanguageVersion langVersion) 4875public void Conversion_Array_Span_Implicit_MethodGroup_ReturnType(LanguageVersion langVersion) 4899public void Conversion_Array_Span_Implicit_MethodGroup_ParameterType(LanguageVersion langVersion) 5129public void Conversion_Array_Span_Implicit_MethodGroup_FunctionPointer(LanguageVersion langVersion) 5267public void Conversion_Array_Span_Implicit_ExpressionTree_02(LanguageVersion langVersion) 5317public void Conversion_Array_ReadOnlySpan_Implicit_ExpressionTree_02(LanguageVersion langVersion) 5396[CombinatorialLangVersions] LanguageVersion langVersion, 5419public void Conversion_Span_ReadOnlySpan_Implicit_ExpressionTree(LanguageVersion langVersion) 5517public void Conversion_string_ReadOnlySpan_Implicit_ExpressionTree(LanguageVersion langVersion) 5537[CombinatorialLangVersions] LanguageVersion langVersion, 5567[CombinatorialLangVersions] LanguageVersion langVersion, 5599[CombinatorialLangVersions] LanguageVersion langVersion, 5711public void Conversion_Array_ReadOnlySpan_Interface_Contravariant(LanguageVersion langVersion) 5730public void Conversion_Array_ReadOnlySpan_Interface_Contravariant_Cast(LanguageVersion langVersion) 5764public void Conversion_Array_ReadOnlySpan_Covariant_ValueType(LanguageVersion langVersion) 5781public void Conversion_Array_ReadOnlySpan_Covariant_TypeParameter(LanguageVersion langVersion) 5810public void Conversion_Array_ReadOnlySpan_TypeParameter_NullableValueType_01(LanguageVersion langVersion) 5827public void Conversion_Array_ReadOnlySpan_TypeParameter_NullableValueType_02(LanguageVersion langVersion) 5846[CombinatorialLangVersions] LanguageVersion langVersion) 5874public void Conversion_Array_Span_Variance_02(LanguageVersion langVersion) 6193[CombinatorialLangVersions] LanguageVersion langVersion)
RefReadonlyParameterTests.cs (5)
3706public void OverloadResolution_07([CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 3729languageVersion == LanguageVersion.CSharp11
Semantics\CollectionExpressionTests.cs (9)
134[InlineData(LanguageVersion.CSharp11)] 135[InlineData(LanguageVersion.Preview)] 136public void LanguageVersionDiagnostics(LanguageVersion languageVersion) 151if (languageVersion == LanguageVersion.CSharp11) 2290[InlineData(LanguageVersion.Preview)] 2291[InlineData(LanguageVersion.CSharp13)] 2292[InlineData(LanguageVersion.CSharp12)] 2293public void BetterConversionFromExpression_09(LanguageVersion version) 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 (96)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
256=> options.LanguageVersion() >= LanguageVersion.CSharp7_2;
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
64ParseOptions: CSharpParseOptions { LanguageVersion: >= LanguageVersion.CSharp8 },
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
56if (root.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp9) 384if (names.Length > 1 && names[0].SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp10)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
103if (languageVersion < LanguageVersion.CSharp7_2 && token.IsMandatoryNamedParameterPosition())
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.cs (3)
31(version >= LanguageVersion.CSharp7 ? Feature.SourcePattern | Feature.IsTypePattern | Feature.CaseGuard : 0) | 32(version >= LanguageVersion.CSharp8 ? Feature.SwitchExpression : 0) | 33(version >= LanguageVersion.CSharp9 ? Feature.RelationalPattern | Feature.OrPattern | Feature.AndPattern | Feature.TypePattern : 0);
ConvertProgram\ConvertToTopLevelStatementsCodeRefactoringProvider.cs (1)
36if (document.Project.ParseOptions!.LanguageVersion() < LanguageVersion.CSharp9 ||
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (2)
172=> node.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp8; 219if (LocalFunction && (!Options.PreferStaticLocalFunction.Value || languageVersion < LanguageVersion.CSharp8))
IntroduceUsingStatement\CSharpIntroduceUsingStatementCodeRefactoringProvider.cs (1)
101options.LanguageVersion() < LanguageVersion.CSharp8)
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
107if (options.LanguageVersion < LanguageVersion.CSharp8)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
90if (parseOptions.LanguageVersion < LanguageVersion.CSharp8)
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (5)
63CSharpCodeGenerationOptions options, LanguageVersion languageVersion, 116CSharpCodeGenerationOptions options, LanguageVersion languageVersion, 166GetAndSetMethods getAndSetMethods, CSharpCodeGenerationOptions options, LanguageVersion languageVersion, CancellationToken cancellationToken) 175CSharpCodeGenerationOptions options, LanguageVersion languageVersion, 236CSharpCodeGenerationOptions options, LanguageVersion languageVersion, CancellationToken cancellationToken)
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (4)
60LanguageVersion languageVersion, 104LanguageVersion languageVersion, 162LanguageVersion languageVersion, 251LanguageVersion languageVersion,
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (2)
48LanguageVersion version) 56if (version < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9 ||
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
36var analyzer = new Analyzer(supportsOrPatterns: semanticModel.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9);
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
35if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\ConvertTypeofToNameof\CSharpConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
29if (node.GetLanguageVersion() < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
68if (csOptions.LanguageVersion < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
52if (ifStatement.SyntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
32if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\MakeLocalFunctionStatic\MakeLocalFunctionStaticHelper.cs (2)
14public static bool IsStaticLocalFunctionSupported(LanguageVersion languageVersion) 15=> languageVersion >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
38if (compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
34if (compilation.LanguageVersion() < LanguageVersion.CSharp7_2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
37if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
30=> tree.Options.LanguageVersion() >= LanguageVersion.CSharp7;
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternDiagnosticAnalyzer.cs (1)
45if (compilationContext.Compilation.LanguageVersion() < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (3)
43=> compilation.LanguageVersion() >= LanguageVersion.CSharp6; 46=> compilation.LanguageVersion() >= LanguageVersion.CSharp6; 49=> compilation.LanguageVersion() >= LanguageVersion.Preview;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (1)
44=> compilation.LanguageVersion() >= LanguageVersion.CSharp3;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundAssignmentDiagnosticAnalyzer.cs (1)
27options.LanguageVersion() >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
46if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (2)
192if (languageVersion < LanguageVersion.CSharp7) 213if (languageVersion < LanguageVersion.CSharp6)
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (3)
57languageVersion < LanguageVersion.CSharp7) 67ExpressionBodyPreference preference, LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken) 109LanguageVersion languageVersion,
src\Analyzers\CSharp\Analyzers\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationDiagnosticAnalyzer.cs (1)
44if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
64if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
57if (compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
38if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer.cs (2)
22=> compilation.LanguageVersion() >= LanguageVersion.CSharp7; 25=> compilation.LanguageVersion() >= LanguageVersion.CSharp8;
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckDiagnosticAnalyzer.cs (1)
36if (compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
61if (compilation.LanguageVersion() < LanguageVersion.CSharp7) 128if (options.LanguageVersion() < LanguageVersion.CSharp10)
src\Analyzers\CSharp\Analyzers\UseNameofInNullableAttribute\CSharpUseNameofInNullableAttributeDiagnosticAnalyzer.cs (1)
47if (context.Compilation.LanguageVersion() >= LanguageVersion.CSharp11)
src\Analyzers\CSharp\Analyzers\UseNullPropagation\CSharpUseNullPropagationDiagnosticAnalyzer.cs (1)
33=> compilation.LanguageVersion() >= LanguageVersion.CSharp6;
src\Analyzers\CSharp\Analyzers\UseObjectInitializer\CSharpUseObjectInitializerDiagnosticAnalyzer.cs (1)
36return compilation.LanguageVersion() >= LanguageVersion.CSharp3;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
60if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndMemberAccessDiagnosticAnalyzer.cs (2)
46if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8) 67asExpression, out var conditionalAccessExpression, out var binaryExpression, out var isPatternExpression, out var requiredLanguageVersion))
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
61if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
52if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpUseNotPatternDiagnosticAnalyzer.cs (1)
42if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp9)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\UsePatternMatchingHelpers.cs (5)
19out LanguageVersion requiredLanguageVersion) 24requiredLanguageVersion = LanguageVersion.CSharp8; 46requiredLanguageVersion = LanguageVersion.CSharp10; 78requiredLanguageVersion = (LanguageVersion)Math.Max((int)requiredLanguageVersion, (int)LanguageVersion.CSharp9);
src\Analyzers\CSharp\Analyzers\UseSimpleUsingStatement\UseSimpleUsingStatementDiagnosticAnalyzer.cs (1)
70if (context.Compilation.LanguageVersion() < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseThrowExpression\CSharpUseThrowExpressionDiagnosticAnalyzer.cs (1)
25=> compilation.LanguageVersion() >= LanguageVersion.CSharp7;
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
53if (compilation.LanguageVersion() < LanguageVersion.CSharp7)
src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
39=> options.LanguageVersion() >= LanguageVersion.CSharp7_3;
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (1)
41if (root.GetLanguageVersion() < LanguageVersion.CSharp11)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
101parent.SyntaxTree.Options.LanguageVersion() >= LanguageVersion.CSharp9)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (7)
68private static LanguageVersion RequiredVersion(ImmutableArray<Diagnostic> diagnostics) 70LanguageVersion max = 0; 74LanguageVersionFacts.TryParse(requiredVersion, out var required)) 80max = LanguageVersion.Preview; 92Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion)); 106Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(newVersion, out var parsedNewVersion)); 109var mappedVersion = parsedNewVersion.MapSpecifiedToEffectiveVersion();
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeActionHelpers.cs (1)
34private static LambdaExpressionSyntax WithExpressionBody(LambdaExpressionSyntax declaration, LanguageVersion languageVersion, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\UseIsNullCheckHelpers.cs (1)
26=> options.LanguageVersion() >= LanguageVersion.CSharp9;
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
89if (languageVersion >= LanguageVersion.CSharp8)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
86LanguageVersion languageVersion, 161LanguageVersion languageVersion, 172if (languageVersion >= LanguageVersion.CSharp9)
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
46=> compilation.LanguageVersion() >= LanguageVersion.CSharp6;
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (1)
36=> options.LanguageVersion() >= LanguageVersion.CSharp7_2;
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
71if (syntaxTree.Options.LanguageVersion() < LanguageVersion.CSharp7)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2002)
AddDebuggerDisplay\AddDebuggerDisplayTests.cs (2)
65LanguageVersion = LanguageVersion.CSharp12, 92LanguageVersion = LanguageVersion.CSharp9,
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);
ConvertForToForEach\ConvertForToForEachTests.cs (2)
1730""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 1768""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp8)));
ConvertIfToSwitch\ConvertIfToSwitchTests.cs (32)
315LanguageVersion = LanguageVersion.CSharp8, 359LanguageVersion = LanguageVersion.CSharp9, 498[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 513LanguageVersion.CSharp8 => 529LanguageVersion.CSharp9 => 627LanguageVersion = LanguageVersion.CSharp8, 668LanguageVersion = LanguageVersion.CSharp8, 1547LanguageVersion = LanguageVersion.CSharp8, 1597LanguageVersion = LanguageVersion.CSharp9, 1639LanguageVersion = LanguageVersion.CSharp8, 1689LanguageVersion = LanguageVersion.CSharp9, 1731LanguageVersion = LanguageVersion.CSharp8, 1781LanguageVersion = LanguageVersion.CSharp9, 1823LanguageVersion = LanguageVersion.CSharp8, 1873LanguageVersion = LanguageVersion.CSharp9, 2431LanguageVersion = LanguageVersion.CSharp8, 2476LanguageVersion = LanguageVersion.CSharp9, 2500LanguageVersion = LanguageVersion.CSharp8, 2540LanguageVersion = LanguageVersion.CSharp9, 2591LanguageVersion = LanguageVersion.CSharp9, 2617LanguageVersion = LanguageVersion.CSharp8, 2669LanguageVersion = LanguageVersion.CSharp9, 2710LanguageVersion = LanguageVersion.CSharp9, 2752LanguageVersion = LanguageVersion.CSharp9, 2801LanguageVersion = LanguageVersion.CSharp9, 2886LanguageVersion = LanguageVersion.CSharp9, 2910LanguageVersion = LanguageVersion.CSharp9, 2932LanguageVersion = LanguageVersion.CSharp9, 2954LanguageVersion = LanguageVersion.CSharp9, 2994LanguageVersion = LanguageVersion.CSharp9,
ConvertLinq\ConvertLinqQueryToForEachTests.cs (2)
4427await TestInRegularAndScriptAsync(source, output, parseOptions: new CSharpParseOptions(CodeAnalysis.CSharp.LanguageVersion.CSharp7_3)); 4471await TestInRegularAndScriptAsync(source, output, parseOptions: new CSharpParseOptions(CodeAnalysis.CSharp.LanguageVersion.CSharp8));
ConvertLocalFunctionToMethod\ConvertLocalFunctionToMethodTests.cs (2)
375""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 414""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7));
ConvertNamespace\ConvertNamespaceRefactoringTests.cs (41)
39LanguageVersion = LanguageVersion.CSharp9, 58LanguageVersion = LanguageVersion.CSharp10, 79LanguageVersion = LanguageVersion.CSharp10, 100LanguageVersion = LanguageVersion.CSharp10, 120LanguageVersion = LanguageVersion.CSharp10, 139LanguageVersion = LanguageVersion.CSharp10, 162LanguageVersion = LanguageVersion.CSharp10, 184LanguageVersion = LanguageVersion.CSharp10, 206LanguageVersion = LanguageVersion.CSharp10, 227LanguageVersion = LanguageVersion.CSharp10, 248LanguageVersion = LanguageVersion.CSharp10, 273LanguageVersion = LanguageVersion.CSharp10, 297LanguageVersion = LanguageVersion.CSharp10, 325LanguageVersion = LanguageVersion.CSharp10, 355LanguageVersion = LanguageVersion.CSharp10, 384LanguageVersion = LanguageVersion.CSharp10, 412LanguageVersion = LanguageVersion.CSharp10, 442LanguageVersion = LanguageVersion.CSharp10, 470LanguageVersion = LanguageVersion.CSharp10, 502LanguageVersion = LanguageVersion.CSharp10, 538LanguageVersion = LanguageVersion.CSharp10, 574LanguageVersion = LanguageVersion.CSharp10, 600LanguageVersion = LanguageVersion.CSharp9, 617LanguageVersion = LanguageVersion.CSharp10, 638LanguageVersion = LanguageVersion.CSharp10, 659LanguageVersion = LanguageVersion.CSharp10, 677LanguageVersion = LanguageVersion.CSharp10, 695LanguageVersion = LanguageVersion.CSharp10, 712LanguageVersion = LanguageVersion.CSharp10, 740LanguageVersion = LanguageVersion.CSharp10, 764LanguageVersion = LanguageVersion.CSharp10, 791LanguageVersion = LanguageVersion.CSharp10, 816LanguageVersion = LanguageVersion.CSharp10, 840LanguageVersion = LanguageVersion.CSharp10, 865LanguageVersion = LanguageVersion.CSharp10, 889LanguageVersion = LanguageVersion.CSharp10, 917LanguageVersion = LanguageVersion.CSharp10, 947LanguageVersion = LanguageVersion.CSharp10, 975LanguageVersion = LanguageVersion.CSharp10, 1004LanguageVersion = LanguageVersion.CSharp10, 1034LanguageVersion = LanguageVersion.CSharp10,
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorTests.cs (80)
50LanguageVersion = LanguageVersion.CSharp12, 69LanguageVersion = LanguageVersion.CSharp12, 92LanguageVersion = LanguageVersion.CSharp12, 121LanguageVersion = LanguageVersion.CSharp12, 158LanguageVersion = LanguageVersion.CSharp12, 195LanguageVersion = LanguageVersion.CSharp12, 234LanguageVersion = LanguageVersion.CSharp12, 273LanguageVersion = LanguageVersion.CSharp12, 314LanguageVersion = LanguageVersion.CSharp12, 340LanguageVersion = LanguageVersion.CSharp12, 366LanguageVersion = LanguageVersion.CSharp12, 392LanguageVersion = LanguageVersion.CSharp12, 418LanguageVersion = LanguageVersion.CSharp12, 444LanguageVersion = LanguageVersion.CSharp12, 473LanguageVersion = LanguageVersion.CSharp12, 502LanguageVersion = LanguageVersion.CSharp12, 529LanguageVersion = LanguageVersion.CSharp12, 565LanguageVersion = LanguageVersion.CSharp12, 601LanguageVersion = LanguageVersion.CSharp12, 623LanguageVersion = LanguageVersion.CSharp12, 649LanguageVersion = LanguageVersion.CSharp12, 701LanguageVersion = LanguageVersion.CSharp12, 739LanguageVersion = LanguageVersion.CSharp12, 777LanguageVersion = LanguageVersion.CSharp12, 817LanguageVersion = LanguageVersion.CSharp12, 859LanguageVersion = LanguageVersion.CSharp12, 901LanguageVersion = LanguageVersion.CSharp12, 944LanguageVersion = LanguageVersion.CSharp12, 975LanguageVersion = LanguageVersion.CSharp12, 1011LanguageVersion = LanguageVersion.CSharp12, 1051LanguageVersion = LanguageVersion.CSharp12, 1081LanguageVersion = LanguageVersion.CSharp12, 1129LanguageVersion = LanguageVersion.CSharp12, 1173LanguageVersion = LanguageVersion.CSharp12, 1213LanguageVersion = LanguageVersion.CSharp12, 1261LanguageVersion = LanguageVersion.CSharp12, 1310LanguageVersion = LanguageVersion.CSharp12, 1357LanguageVersion = LanguageVersion.CSharp12, 1393LanguageVersion = LanguageVersion.CSharp12, 1425LanguageVersion = LanguageVersion.CSharp12, 1457LanguageVersion = LanguageVersion.CSharp12, 1489LanguageVersion = LanguageVersion.CSharp12, 1525LanguageVersion = LanguageVersion.CSharp12, 1557LanguageVersion = LanguageVersion.CSharp12, 1593LanguageVersion = LanguageVersion.CSharp12, 1635LanguageVersion = LanguageVersion.CSharp12, 1673LanguageVersion = LanguageVersion.CSharp12, 1711LanguageVersion = LanguageVersion.CSharp12, 1753LanguageVersion = LanguageVersion.CSharp12, 1780LanguageVersion = LanguageVersion.CSharp12, 1808LanguageVersion = LanguageVersion.CSharp12, 1842LanguageVersion = LanguageVersion.CSharp12, 1878LanguageVersion = LanguageVersion.CSharp12, 1915LanguageVersion = LanguageVersion.CSharp12, 1954LanguageVersion = LanguageVersion.CSharp12, 1986LanguageVersion = LanguageVersion.CSharp12, 2021LanguageVersion = LanguageVersion.CSharp12, 2049LanguageVersion = LanguageVersion.CSharp12, 2083LanguageVersion = LanguageVersion.CSharp12, 2113LanguageVersion = LanguageVersion.CSharp12, 2149LanguageVersion = LanguageVersion.CSharp12, 2177LanguageVersion = LanguageVersion.CSharp12, 2211LanguageVersion = LanguageVersion.CSharp12, 2241LanguageVersion = LanguageVersion.CSharp12, 2277LanguageVersion = LanguageVersion.CSharp12, 2306LanguageVersion = LanguageVersion.CSharp12, 2339LanguageVersion = LanguageVersion.CSharp12, 2368LanguageVersion = LanguageVersion.CSharp12, 2401LanguageVersion = LanguageVersion.CSharp12, 2427LanguageVersion = LanguageVersion.CSharp12, 2449LanguageVersion = LanguageVersion.CSharp12, 2480LanguageVersion = LanguageVersion.CSharp12, 2520LanguageVersion = LanguageVersion.CSharp12, 2552LanguageVersion = LanguageVersion.CSharp12, 2592LanguageVersion = LanguageVersion.CSharp12, 2632LanguageVersion = LanguageVersion.CSharp12, 2661LanguageVersion = LanguageVersion.CSharp12, 2689LanguageVersion = LanguageVersion.CSharp12, 2717LanguageVersion = LanguageVersion.CSharp12, 2738LanguageVersion = LanguageVersion.CSharp12,
ConvertProgram\ConvertToProgramMainAnalyzerTests.cs (25)
31LanguageVersion = LanguageVersion.CSharp9, 53LanguageVersion = LanguageVersion.CSharp9, 78LanguageVersion = LanguageVersion.CSharp9, 106LanguageVersion = LanguageVersion.CSharp9, 136LanguageVersion = LanguageVersion.CSharp9, 152LanguageVersion = LanguageVersion.CSharp9, 167LanguageVersion = LanguageVersion.CSharp9, 190LanguageVersion = LanguageVersion.CSharp9, 213LanguageVersion = LanguageVersion.CSharp9, 244LanguageVersion = LanguageVersion.CSharp9, 275LanguageVersion = LanguageVersion.CSharp9, 314LanguageVersion = LanguageVersion.CSharp9, 342LanguageVersion = LanguageVersion.CSharp9, 374LanguageVersion = LanguageVersion.CSharp9, 403LanguageVersion = LanguageVersion.CSharp9, 434LanguageVersion = LanguageVersion.CSharp9, 462LanguageVersion = LanguageVersion.CSharp9, 491LanguageVersion = LanguageVersion.CSharp9, 516LanguageVersion = LanguageVersion.CSharp9, 540LanguageVersion = LanguageVersion.CSharp9, 575LanguageVersion = LanguageVersion.CSharp9, 614LanguageVersion = LanguageVersion.CSharp9, 648LanguageVersion = LanguageVersion.CSharp9, 687LanguageVersion = LanguageVersion.CSharp11, 724LanguageVersion = LanguageVersion.CSharp9,
ConvertProgram\ConvertToProgramMainRefactoringTests.cs (8)
34LanguageVersion = LanguageVersion.CSharp10, 53LanguageVersion = LanguageVersion.CSharp10, 80LanguageVersion = LanguageVersion.CSharp10, 94LanguageVersion = LanguageVersion.CSharp10, 115LanguageVersion = LanguageVersion.CSharp10, 133LanguageVersion = LanguageVersion.CSharp10, 151LanguageVersion = LanguageVersion.CSharp10, 177LanguageVersion = LanguageVersion.CSharp10,
ConvertProgram\ConvertToTopLevelStatementsAnalyzerTests.cs (56)
47LanguageVersion = LanguageVersion.CSharp9, 69LanguageVersion = LanguageVersion.CSharp8, 92LanguageVersion = LanguageVersion.CSharp9, 117LanguageVersion = LanguageVersion.CSharp9, 145LanguageVersion = LanguageVersion.CSharp9, 173LanguageVersion = LanguageVersion.CSharp10, 202LanguageVersion = LanguageVersion.CSharp10, 225LanguageVersion = LanguageVersion.CSharp9, 247LanguageVersion = LanguageVersion.CSharp9, 269LanguageVersion = LanguageVersion.CSharp9, 291LanguageVersion = LanguageVersion.CSharp9, 318LanguageVersion = LanguageVersion.CSharp9, 345LanguageVersion = LanguageVersion.CSharp9, 369LanguageVersion = LanguageVersion.CSharp9, 390LanguageVersion = LanguageVersion.CSharp9, 412LanguageVersion = LanguageVersion.CSharp9, 434LanguageVersion = LanguageVersion.CSharp9, 460LanguageVersion = LanguageVersion.CSharp9, 482LanguageVersion = LanguageVersion.CSharp9, 505LanguageVersion = LanguageVersion.CSharp9, 528LanguageVersion = LanguageVersion.CSharp9, 553LanguageVersion = LanguageVersion.CSharp9, 578LanguageVersion = LanguageVersion.CSharp9, 603LanguageVersion = LanguageVersion.CSharp9, 628LanguageVersion = LanguageVersion.CSharp9, 653LanguageVersion = LanguageVersion.CSharp9, 677LanguageVersion = LanguageVersion.CSharp9, 701LanguageVersion = LanguageVersion.CSharp9, 727LanguageVersion = LanguageVersion.CSharp9, 753LanguageVersion = LanguageVersion.CSharp9, 777LanguageVersion = LanguageVersion.CSharp9, 801LanguageVersion = LanguageVersion.CSharp9, 825LanguageVersion = LanguageVersion.CSharp9, 847LanguageVersion = LanguageVersion.CSharp9, 874LanguageVersion = LanguageVersion.CSharp9, 901LanguageVersion = LanguageVersion.CSharp9, 928LanguageVersion = LanguageVersion.CSharp9, 955LanguageVersion = LanguageVersion.CSharp9, 982LanguageVersion = LanguageVersion.CSharp9, 1009LanguageVersion = LanguageVersion.CSharp9, 1036LanguageVersion = LanguageVersion.CSharp9, 1063LanguageVersion = LanguageVersion.CSharp9, 1092LanguageVersion = LanguageVersion.CSharp9, 1116LanguageVersion = LanguageVersion.CSharp9, 1145LanguageVersion = LanguageVersion.CSharp9, 1182LanguageVersion = LanguageVersion.CSharp9, 1219LanguageVersion = LanguageVersion.CSharp9, 1260LanguageVersion = LanguageVersion.CSharp9, 1287LanguageVersion = LanguageVersion.CSharp9, 1328LanguageVersion = LanguageVersion.CSharp9, 1367LanguageVersion = LanguageVersion.CSharp10, 1409LanguageVersion = LanguageVersion.CSharp9, 1449LanguageVersion = LanguageVersion.CSharp10, 1479LanguageVersion = LanguageVersion.CSharp9, 1508LanguageVersion = LanguageVersion.CSharp10, 1553LanguageVersion = LanguageVersion.CSharp9,
ConvertProgram\ConvertToTopLevelStatementsRefactoringTests.cs (9)
34LanguageVersion = LanguageVersion.CSharp10, 61LanguageVersion = LanguageVersion.CSharp10, 84LanguageVersion = LanguageVersion.CSharp10, 109LanguageVersion = LanguageVersion.CSharp10, 133LanguageVersion = LanguageVersion.CSharp10, 164LanguageVersion = LanguageVersion.CSharp8, 188LanguageVersion = LanguageVersion.CSharp10, 212LanguageVersion = LanguageVersion.CSharp10, 239LanguageVersion = LanguageVersion.CSharp10,
ConvertToInterpolatedString\ConvertConcatenationToInterpolatedStringTests.cs (5)
1017LanguageVersion = LanguageVersion.CSharp9, 1027LanguageVersion = LanguageVersion.Preview, 1073LanguageVersion = LanguageVersion.CSharp9, 1079LanguageVersion = LanguageVersion.Preview, 1402LanguageVersion = LanguageVersion.CSharp11,
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringTests.cs (4)
165""", new(new CSharpParseOptions(LanguageVersion.CSharp9))); 189""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 218""", new(new CSharpParseOptions(LanguageVersion.CSharp9))); 240""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10));
ConvertToRawString\ConvertInterpolatedStringToRawStringTests.cs (1)
30LanguageVersion = LanguageVersion.CSharp11,
ConvertToRawString\ConvertRegularStringToRawStringTests.cs (1)
27LanguageVersion = LanguageVersion.CSharp11,
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (2)
4692LanguageVersion = LanguageVersion.CSharp10; 4736LanguageVersion = LanguageVersion.CSharp10;
ConvertTupleToStruct\ConvertTupleToStructTests.cs (5)
46LanguageVersion languageVersion = LanguageVersion.CSharp9, 172await TestAsync(text, expected, languageVersion: LanguageVersion.CSharp12, options: PreferImplicitTypeWithInfo(), testHost: host); 213await TestAsync(text, expected, languageVersion: LanguageVersion.CSharp12, options: PreferImplicitTypeWithInfo(), testHost: host); 250await TestAsync(text, expected, languageVersion: LanguageVersion.CSharp12, options: PreferImplicitTypeWithInfo(), testHost: host);
EditAndContinue\Helpers\EditingTestBase.cs (1)
132CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12),
EmbeddedLanguages\JsonStringDetectorTests.cs (1)
102LanguageVersion = LanguageVersion.CSharp12,
EnableNullable\EnableNullableTests.cs (21)
560[InlineData(LanguageVersion.CSharp1)] 561[InlineData(LanguageVersion.CSharp2)] 562[InlineData(LanguageVersion.CSharp3)] 563[InlineData(LanguageVersion.CSharp4)] 564[InlineData(LanguageVersion.CSharp5)] 565[InlineData(LanguageVersion.CSharp6)] 566[InlineData(LanguageVersion.CSharp7)] 567[InlineData(LanguageVersion.CSharp7_1)] 568[InlineData(LanguageVersion.CSharp7_2)] 569[InlineData(LanguageVersion.CSharp7_3)] 570public async Task DisabledForUnsupportedLanguageVersion(LanguageVersion languageVersion) 578LanguageVersion.CSharp1 => "CS8022", 579LanguageVersion.CSharp2 => "CS8023", 580LanguageVersion.CSharp3 => "CS8024", 581LanguageVersion.CSharp4 => "CS8025", 582LanguageVersion.CSharp5 => "CS8026", 583LanguageVersion.CSharp6 => "CS8059", 584LanguageVersion.CSharp7 => "CS8107", 585LanguageVersion.CSharp7_1 => "CS8302", 586LanguageVersion.CSharp7_2 => "CS8320", 587LanguageVersion.CSharp7_3 => "CS8370",
ExtractClass\ExtractClassTests.cs (21)
52var unusedParseOptions = new CSharpParseOptions(LanguageVersion.CSharp1); 243LanguageVersion = LanguageVersion.CSharp9, 287LanguageVersion = LanguageVersion.CSharp12, 328LanguageVersion = LanguageVersion.CSharp9, 369LanguageVersion = LanguageVersion.CSharp9, 408LanguageVersion = LanguageVersion.CSharp12, 434LanguageVersion = LanguageVersion.CSharp9, 451LanguageVersion = LanguageVersion.CSharp12, 466LanguageVersion = LanguageVersion.CSharp12, 483LanguageVersion = LanguageVersion.CSharp12, 498LanguageVersion = LanguageVersion.CSharp12, 518LanguageVersion = LanguageVersion.CSharp10, 538LanguageVersion = LanguageVersion.CSharp12, 642LanguageVersion = LanguageVersion.CSharp10, 699LanguageVersion = LanguageVersion.CSharp9, 756LanguageVersion = LanguageVersion.CSharp10, 1281LanguageVersion = LanguageVersion.CSharp10, 1355LanguageVersion = LanguageVersion.CSharp10, 1413LanguageVersion = LanguageVersion.CSharp10, 1485LanguageVersion = LanguageVersion.CSharp10, 2843LanguageVersion = LanguageVersion.CSharp10,
ExtractMethod\ExtractLocalFunctionTests.cs (17)
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))); 5195LanguageVersion = LanguageVersion.CSharp9, 5236LanguageVersion = LanguageVersion.CSharp9, 5285LanguageVersion = LanguageVersion.CSharp9, 5338LanguageVersion = LanguageVersion.CSharp9, 5368LanguageVersion = LanguageVersion.CSharp9, 5400LanguageVersion = LanguageVersion.CSharp9, 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 (8)
5058LanguageVersion = LanguageVersion.CSharp9, 5096LanguageVersion = LanguageVersion.CSharp9, 5142LanguageVersion = LanguageVersion.CSharp9, 5192LanguageVersion = LanguageVersion.CSharp9, 5216""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 5245""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 5964LanguageVersion = LanguageVersion.CSharp13, 6014LanguageVersion = LanguageVersion.CSharp13,
GenerateFromMembers\AddConstructorParametersFromMembers\AddConstructorParametersFromMembersTests.cs (3)
641LanguageVersion = LanguageVersion.CSharp7 713LanguageVersion = LanguageVersion.CSharp7, 751LanguageVersion = LanguageVersion.CSharp7
GenerateVariable\GenerateVariableTests.cs (4)
4820index: 3, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7)); 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 (15)
387[InlineData(LanguageVersion.CSharp8)] 388[InlineData(LanguageVersion.CSharp9)] 389public async Task Conversion_NonTargetTypedConditionalExpression(LanguageVersion languageVersion) 415[InlineData(LanguageVersion.CSharp8, " (int?)42")] 416[InlineData(LanguageVersion.CSharp9, " 42")] // In C# 9, target-typed conditionals makes this work 417public async Task Conversion_TargetTypedConditionalExpression(LanguageVersion languageVersion, string expectedSubstitution) 4299[InlineData(LanguageVersion.CSharp6)] 4300[InlineData(LanguageVersion.CSharp12)] 4301public async Task Tuples(LanguageVersion 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 (8)
39LanguageVersion languageVersion = LanguageVersion.CSharp7, 503""", LanguageVersion.CSharp8); 1284""", LanguageVersion.CSharp8); 1314""", LanguageVersion.CSharp8); 1346""", LanguageVersion.CSharp8); 1390""", LanguageVersion.CSharp8); 1436""", LanguageVersion.CSharp8);
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);
InvertIf\InvertIfTests.cs (7)
44private static async Task TestAsync(string initial, string expected, LanguageVersion languageVersion = LanguageVersion.Latest) 1198""", LanguageVersion.CSharp6); 1234""", LanguageVersion.CSharp8); 1270""", LanguageVersion.CSharp9); 1309""", LanguageVersion.CSharp8); 1345""", LanguageVersion.CSharp9);
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);
PreferFrameworkType\PreferFrameworkTypeTests.cs (3)
300[InlineData(LanguageVersion.CSharp10)] 301[InlineData(LanguageVersion.CSharp11)] 302public async Task TestNint_WithoutNumericIntPtr(LanguageVersion version)
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (5)
1453""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1468""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 3354""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1))); 3373""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1))); 3392""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1)));
ReplaceConditionalWithStatements\ReplaceConditionalWithStatementsTests.cs (6)
190LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 219LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 316LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10, 500LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10, 529LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10, 558LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp10,
SimplifyPropertyPattern\SimplifyPropertyPatternTests.cs (22)
45LanguageVersion = LanguageVersion.CSharp9, 84LanguageVersion = LanguageVersion.CSharp10, 110LanguageVersion = LanguageVersion.CSharp10, 135LanguageVersion = LanguageVersion.CSharp10, 160LanguageVersion = LanguageVersion.CSharp10, 185LanguageVersion = LanguageVersion.CSharp10, 210LanguageVersion = LanguageVersion.CSharp10, 235LanguageVersion = LanguageVersion.CSharp10, 274LanguageVersion = LanguageVersion.CSharp10, 311LanguageVersion = LanguageVersion.CSharp10, 348LanguageVersion = LanguageVersion.CSharp10, 385LanguageVersion = LanguageVersion.CSharp10, 422LanguageVersion = LanguageVersion.CSharp10, 459LanguageVersion = LanguageVersion.CSharp10, 496LanguageVersion = LanguageVersion.CSharp10, 533LanguageVersion = LanguageVersion.CSharp10, 583LanguageVersion = LanguageVersion.CSharp10, 632LanguageVersion = LanguageVersion.CSharp10, 671LanguageVersion = LanguageVersion.CSharp10, 723LanguageVersion = LanguageVersion.CSharp10, 746LanguageVersion = LanguageVersion.CSharp10, 768LanguageVersion = LanguageVersion.CSharp10,
SimplifyTypeNames\SimplifyTypeNamesTests.cs (7)
5124parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 7234source, new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), options: featureOptions)); 7278[InlineData(LanguageVersion.CSharp9)] 7279[InlineData(LanguageVersion.CSharp10)] 7280[InlineData(LanguageVersion.CSharp11)] 7281public async Task TestNint1_WithNumericIntPtr_NoRuntimeSupport(LanguageVersion version) 7307source, new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), options: featureOptions));
src\Analyzers\CSharp\Tests\AddAccessibilityModifiers\AddAccessibilityModifiersTests.cs (13)
203LanguageVersion = LanguageVersion.CSharp9, 229LanguageVersion = LanguageVersion.CSharp12, 566LanguageVersion = LanguageVersion.CSharp10, 596LanguageVersion = LanguageVersion.CSharp12, 623LanguageVersion = LanguageVersion.CSharp12, 645LanguageVersion = LanguageVersion.CSharp12, 657LanguageVersion = LanguageVersion.CSharp12, 689LanguageVersion = LanguageVersion.CSharp12, 713LanguageVersion = LanguageVersion.CSharp12, 740LanguageVersion = LanguageVersion.CSharp12, 789LanguageVersion = LanguageVersion.CSharp12, 837LanguageVersion = LanguageVersion.CSharp12, 885LanguageVersion = LanguageVersion.CSharp12,
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\ConvertNamespace\ConvertToBlockScopedNamespaceAnalyzerTests.cs (21)
46LanguageVersion = LanguageVersion.CSharp9, 67LanguageVersion = LanguageVersion.CSharp9, 84LanguageVersion = LanguageVersion.CSharp10, 106LanguageVersion = LanguageVersion.CSharp10, 133LanguageVersion = LanguageVersion.CSharp10, 160LanguageVersion = LanguageVersion.CSharp10, 189LanguageVersion = LanguageVersion.CSharp10, 216LanguageVersion = LanguageVersion.CSharp10, 245LanguageVersion = LanguageVersion.CSharp10, 272LanguageVersion = LanguageVersion.CSharp10, 306LanguageVersion = LanguageVersion.CSharp10, 339LanguageVersion = LanguageVersion.CSharp10, 364LanguageVersion = LanguageVersion.CSharp10, 388LanguageVersion = LanguageVersion.CSharp10, 413LanguageVersion = LanguageVersion.CSharp10, 437LanguageVersion = LanguageVersion.CSharp10, 465LanguageVersion = LanguageVersion.CSharp10, 495LanguageVersion = LanguageVersion.CSharp10, 523LanguageVersion = LanguageVersion.CSharp10, 552LanguageVersion = LanguageVersion.CSharp10, 582LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertNamespace\ConvertToFileScopedNamespaceAnalyzerTests.cs (43)
32LanguageVersion = LanguageVersion.CSharp9, 51LanguageVersion = LanguageVersion.CSharp10, 72LanguageVersion = LanguageVersion.CSharp10, 93LanguageVersion = LanguageVersion.CSharp10, 116LanguageVersion = LanguageVersion.CSharp10, 138LanguageVersion = LanguageVersion.CSharp10, 159LanguageVersion = LanguageVersion.CSharp10, 180LanguageVersion = LanguageVersion.CSharp10, 212LanguageVersion = LanguageVersion.CSharp10, 236LanguageVersion = LanguageVersion.CSharp10, 264LanguageVersion = LanguageVersion.CSharp10, 294LanguageVersion = LanguageVersion.CSharp10, 323LanguageVersion = LanguageVersion.CSharp10, 351LanguageVersion = LanguageVersion.CSharp10, 381LanguageVersion = LanguageVersion.CSharp10, 411LanguageVersion = LanguageVersion.CSharp10, 452LanguageVersion = LanguageVersion.CSharp10, 486LanguageVersion = LanguageVersion.CSharp10, 520LanguageVersion = LanguageVersion.CSharp10, 568LanguageVersion = LanguageVersion.CSharp10, 616LanguageVersion = LanguageVersion.CSharp10, 666LanguageVersion = LanguageVersion.CSharp10, 720LanguageVersion = LanguageVersion.CSharp12, 775LanguageVersion = LanguageVersion.CSharp12, 830LanguageVersion = LanguageVersion.CSharp12, 850LanguageVersion = LanguageVersion.CSharp10, 871LanguageVersion = LanguageVersion.CSharp10, 899LanguageVersion = LanguageVersion.CSharp10, 920LanguageVersion = LanguageVersion.CSharp10, 948LanguageVersion = LanguageVersion.CSharp10, 969LanguageVersion = LanguageVersion.CSharp10, 999LanguageVersion = LanguageVersion.CSharp10, 1031LanguageVersion = LanguageVersion.CSharp10, 1060LanguageVersion = LanguageVersion.CSharp10, 1090LanguageVersion = LanguageVersion.CSharp10, 1162LanguageVersion = LanguageVersion.CSharp11, 1232LanguageVersion = LanguageVersion.CSharp11, 1304LanguageVersion = LanguageVersion.CSharp11, 1390LanguageVersion = LanguageVersion.CSharp11, 1462LanguageVersion = LanguageVersion.CSharp11, 1534LanguageVersion = LanguageVersion.CSharp11, 1555LanguageVersion = LanguageVersion.CSharp10, 1576LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs (6)
27private static readonly LanguageVersion CSharp9 = LanguageVersion.CSharp9; 2163LanguageVersion = LanguageVersion.CSharp9, 2207LanguageVersion = LanguageVersion.CSharp9, 2530LanguageVersion = LanguageVersion.CSharp9, 2587LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
154LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\ConvertTypeOfToNameOf\ConvertTypeOfToNameOfTests.cs (1)
361LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\FixReturnType\FixReturnTypeTests.cs (1)
224LanguageVersion = LanguageVersion.CSharp10
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\GenerateDefaultConstructors\GenerateDefaultConstructorsTests.cs (5)
51LanguageVersion = LanguageVersion.CSharp10, 66LanguageVersion = LanguageVersion.CSharp10, 81LanguageVersion = LanguageVersion.CSharp10, 93LanguageVersion = LanguageVersion.CSharp10, 958LanguageVersion = LanguageVersion.CSharp12,
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\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
1836""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
src\Analyzers\CSharp\Tests\ImplementInterface\ImplementInterfaceTests.cs (41)
74LanguageVersion = LanguageVersion.CSharp12, 113LanguageVersion = LanguageVersion.CSharp12, 152LanguageVersion = LanguageVersion.CSharp12, 202LanguageVersion = LanguageVersion.CSharp9, 4060LanguageVersion = LanguageVersion.CSharp7_2, 4099LanguageVersion = LanguageVersion.CSharp8, 8318LanguageVersion = LanguageVersion.CSharp7_1, 10419LanguageVersion = LanguageVersion.CSharp9, 10545LanguageVersion = LanguageVersion.CSharp12, 10578LanguageVersion = LanguageVersion.CSharp12, 10611LanguageVersion = LanguageVersion.CSharp12, 10644LanguageVersion = LanguageVersion.CSharp12, 10681LanguageVersion = LanguageVersion.CSharp12, 10712LanguageVersion = LanguageVersion.CSharp9, 10776LanguageVersion = LanguageVersion.CSharp9, 10813LanguageVersion = LanguageVersion.CSharp9, 10850LanguageVersion = LanguageVersion.CSharp9, 11024LanguageVersion = LanguageVersion.CSharp5, 11071LanguageVersion = LanguageVersion.CSharp12, 11108LanguageVersion = LanguageVersion.CSharp12, 11145LanguageVersion = LanguageVersion.CSharp12, 11182LanguageVersion = LanguageVersion.CSharp12, 11217LanguageVersion = LanguageVersion.CSharp12, 11252LanguageVersion = LanguageVersion.CSharp12, 11294LanguageVersion = LanguageVersion.CSharp12, 11329LanguageVersion = LanguageVersion.CSharp12, 11364LanguageVersion = LanguageVersion.CSharp12, 11400LanguageVersion = LanguageVersion.CSharp12, 11436LanguageVersion = LanguageVersion.CSharp12, 11472LanguageVersion = LanguageVersion.CSharp12, 11508LanguageVersion = LanguageVersion.CSharp12, 11544LanguageVersion = LanguageVersion.CSharp12, 11580LanguageVersion = LanguageVersion.CSharp12, 11656LanguageVersion = LanguageVersion.CSharp12, 11732LanguageVersion = LanguageVersion.CSharp12, 11807LanguageVersion = LanguageVersion.CSharp7_3, 11846LanguageVersion = LanguageVersion.CSharp7_2, 11886LanguageVersion = LanguageVersion.CSharp12, 12035LanguageVersion = LanguageVersion.CSharp12, 12232LanguageVersion = LanguageVersion.CSharp9, 12277LanguageVersion = LanguageVersion.CSharp10,
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\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticTests.cs (3)
26LanguageVersion = LanguageVersion.CSharp9 55LanguageVersion = LanguageVersion.CSharp8 84LanguageVersion = LanguageVersion.CSharp9,
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\MakeMemberRequired\MakeMemberRequiredTests.cs (22)
138LanguageVersion = LanguageVersion.CSharp11, 162LanguageVersion = LanguageVersion.CSharp11, 186LanguageVersion = LanguageVersion.CSharp11, 206LanguageVersion = LanguageVersion.CSharp11, 239LanguageVersion = LanguageVersion.CSharp11, 261LanguageVersion = LanguageVersion.CSharp11, 288LanguageVersion = LanguageVersion.CSharp11, 307LanguageVersion = LanguageVersion.CSharp11, 334LanguageVersion = LanguageVersion.CSharp11, 353LanguageVersion = LanguageVersion.CSharp11, 379LanguageVersion = LanguageVersion.CSharp11, 412LanguageVersion = LanguageVersion.CSharp11, 434LanguageVersion = LanguageVersion.CSharp11, 454LanguageVersion = LanguageVersion.CSharp10, 475LanguageVersion = LanguageVersion.CSharp11, 495LanguageVersion = LanguageVersion.CSharp11, 521LanguageVersion = LanguageVersion.CSharp11, 547LanguageVersion = LanguageVersion.CSharp11, 571LanguageVersion = LanguageVersion.CSharp11, 595LanguageVersion = LanguageVersion.CSharp11, 621LanguageVersion = LanguageVersion.CSharp11, 645LanguageVersion = LanguageVersion.CSharp11,
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\MakeStructMemberReadOnly\MakeStructMemberReadOnlyTests.cs (35)
458LanguageVersion = LanguageVersion.CSharp7, 999LanguageVersion = LanguageVersion.CSharp10, 1408LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1476LanguageVersion = LanguageVersion.CSharp12, 1534LanguageVersion = LanguageVersion.CSharp12, 1592LanguageVersion = LanguageVersion.CSharp12, 1650LanguageVersion = LanguageVersion.CSharp12, 1708LanguageVersion = LanguageVersion.CSharp12, 1728LanguageVersion = LanguageVersion.CSharp12, 1748LanguageVersion = LanguageVersion.CSharp12, 1768LanguageVersion = LanguageVersion.CSharp12, 1791LanguageVersion = LanguageVersion.CSharp12, 1814LanguageVersion = LanguageVersion.CSharp12, 1839LanguageVersion = LanguageVersion.CSharp12, 1880LanguageVersion = LanguageVersion.CSharp12, 1907LanguageVersion = LanguageVersion.CSharp12, 1925LanguageVersion = LanguageVersion.CSharp12, 1966LanguageVersion = LanguageVersion.CSharp12, 2007LanguageVersion = LanguageVersion.CSharp12, 2038LanguageVersion = LanguageVersion.CSharp12, 2058LanguageVersion = LanguageVersion.CSharp12, 2078LanguageVersion = LanguageVersion.CSharp12, 2105LanguageVersion = LanguageVersion.CSharp12, 2149LanguageVersion = LanguageVersion.CSharp12, 2176LanguageVersion = LanguageVersion.CSharp12, 2216LanguageVersion = LanguageVersion.CSharp12, 2264LanguageVersion = LanguageVersion.CSharp12, 2314LanguageVersion = LanguageVersion.CSharp12, 2364LanguageVersion = LanguageVersion.CSharp12, 2424LanguageVersion = LanguageVersion.CSharp12, 2460LanguageVersion = LanguageVersion.CSharp12, 2490LanguageVersion = LanguageVersion.CSharp12, 2520LanguageVersion = LanguageVersion.CSharp12, 2554LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\MakeStructReadOnly\MakeStructReadOnlyTests.cs (7)
23private static Task TestMissingAsync(string testCode, LanguageVersion version = LanguageVersion.CSharp12) 26private static async Task TestAsync(string testCode, string fixedCode, LanguageVersion version = LanguageVersion.CSharp12) 46""", LanguageVersion.CSharp7_1); 65LanguageVersion.CSharp7_2); 450LanguageVersion.CSharp12);
src\Analyzers\CSharp\Tests\MakeTypePartial\MakeTypePartialTests.cs (11)
56LanguageVersion = LanguageVersion.CSharp10 88LanguageVersion = LanguageVersion.CSharp10 122LanguageVersion = LanguageVersion.CSharp10 162LanguageVersion = LanguageVersion.CSharp10 198LanguageVersion = LanguageVersion.CSharp10 226LanguageVersion = LanguageVersion.CSharp10 260LanguageVersion = LanguageVersion.CSharp10 302LanguageVersion = LanguageVersion.CSharp10 341LanguageVersion = LanguageVersion.CSharp10, 350LanguageVersion = LanguageVersion.CSharp10, 379LanguageVersion = LanguageVersion.CSharp10
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (2)
58LanguageVersion = LanguageVersion.CSharp10, 948LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementTests.cs (4)
266LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 345LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 803LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 849LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\NewLines\MultipleBlankLines\MultipleBlankLinesTests.cs (10)
534LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 552LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 578LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 605LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 632LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 770LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 793LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 832LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 875LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8, 922LanguageVersion = Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
24private static readonly TestParameters s_nullableFeature = new TestParameters(parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveConfusingSuppression\RemoveConfusingSuppressionTests.cs (4)
104LanguageVersion = LanguageVersion.CSharp8 138LanguageVersion = LanguageVersion.CSharp8, 172LanguageVersion = LanguageVersion.CSharp9, 211LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryCast\RemoveUnnecessaryCastTests.cs (103)
5768LanguageVersion = LanguageVersion.CSharp7_1, 5793LanguageVersion = LanguageVersion.CSharp7_1, 5818LanguageVersion = LanguageVersion.CSharp7_1, 5858LanguageVersion = LanguageVersion.CSharp7_1, 5909LanguageVersion = LanguageVersion.CSharp7_1, 5934LanguageVersion = LanguageVersion.CSharp7_1, 5959LanguageVersion = LanguageVersion.CSharp7_1, 5999LanguageVersion = LanguageVersion.CSharp7_1, 6039LanguageVersion = LanguageVersion.CSharp7_1, 6060LanguageVersion = LanguageVersion.CSharp7_1, 6081LanguageVersion = LanguageVersion.CSharp7_1, 6102LanguageVersion = LanguageVersion.CSharp7_1, 6134LanguageVersion = LanguageVersion.CSharp7_1, 6157LanguageVersion = LanguageVersion.CSharp10, 6180LanguageVersion = LanguageVersion.CSharp10, 8229LanguageVersion = LanguageVersion.CSharp9, 8301LanguageVersion = LanguageVersion.CSharp8 8328LanguageVersion = LanguageVersion.CSharp9, 8349LanguageVersion = LanguageVersion.CSharp8 8376LanguageVersion = LanguageVersion.CSharp9, 8397LanguageVersion = LanguageVersion.CSharp8, 8424LanguageVersion = LanguageVersion.CSharp9, 8496LanguageVersion = LanguageVersion.CSharp8 8523LanguageVersion = LanguageVersion.CSharp9, 8544LanguageVersion = LanguageVersion.CSharp8 8571LanguageVersion = LanguageVersion.CSharp9, 8592LanguageVersion = LanguageVersion.CSharp8 8619LanguageVersion = LanguageVersion.CSharp9, 8797LanguageVersion = LanguageVersion.CSharp9, 9622LanguageVersion = LanguageVersion.CSharp9 9643LanguageVersion = LanguageVersion.CSharp9 9673LanguageVersion = LanguageVersion.CSharp9 9694LanguageVersion = LanguageVersion.CSharp9 9715LanguageVersion = LanguageVersion.CSharp9 9800LanguageVersion = LanguageVersion.CSharp9 9823LanguageVersion = LanguageVersion.CSharp9 9846LanguageVersion = LanguageVersion.CSharp9 9875LanguageVersion = LanguageVersion.CSharp9 9905LanguageVersion = LanguageVersion.CSharp9 9923LanguageVersion = LanguageVersion.CSharp9, 9946LanguageVersion = LanguageVersion.CSharp9, 9982LanguageVersion = LanguageVersion.CSharp9, 10010LanguageVersion = LanguageVersion.CSharp9, 10033LanguageVersion = LanguageVersion.CSharp9, 10055LanguageVersion = LanguageVersion.CSharp9, 10890LanguageVersion = LanguageVersion.CSharp9, 10929LanguageVersion = LanguageVersion.CSharp9, 11629LanguageVersion = LanguageVersion.CSharp10, 12067public async Task DoNotRemoveMethodGroupToSpecificDelegateType(LanguageVersion version) 12123LanguageVersion = LanguageVersion.CSharp10, 12159LanguageVersion = LanguageVersion.CSharp10, 12183LanguageVersion = LanguageVersion.CSharp10, 12205LanguageVersion = LanguageVersion.CSharp10, 12226LanguageVersion = LanguageVersion.CSharp10, 12247LanguageVersion = LanguageVersion.CSharp10, 12270LanguageVersion = LanguageVersion.CSharp10, 12292LanguageVersion = LanguageVersion.CSharp10, 12308LanguageVersion = LanguageVersion.CSharp10, 12330LanguageVersion = LanguageVersion.CSharp10, 12354LanguageVersion = LanguageVersion.CSharp10, 12373LanguageVersion = LanguageVersion.CSharp10, 12392LanguageVersion = LanguageVersion.CSharp10, 12416LanguageVersion = LanguageVersion.CSharp10, 12439LanguageVersion = LanguageVersion.CSharp10, 12470LanguageVersion = LanguageVersion.CSharp10, 12520LanguageVersion = LanguageVersion.CSharp10, 12561LanguageVersion = LanguageVersion.CSharp10, 12588LanguageVersion = LanguageVersion.CSharp10, 12635LanguageVersion = LanguageVersion.CSharp10, 12680LanguageVersion = LanguageVersion.CSharp10, 12699LanguageVersion = LanguageVersion.CSharp10, 12730LanguageVersion = LanguageVersion.CSharp10, 12761LanguageVersion = LanguageVersion.CSharp10, 12792LanguageVersion = LanguageVersion.CSharp10, 12823LanguageVersion = LanguageVersion.CSharp10, 12854LanguageVersion = LanguageVersion.CSharp10, 12885LanguageVersion = LanguageVersion.CSharp10, 12904LanguageVersion = LanguageVersion.CSharp10, 12930LanguageVersion = LanguageVersion.CSharp10, 12966LanguageVersion = LanguageVersion.CSharp10, 13001LanguageVersion = LanguageVersion.CSharp10, 13020LanguageVersion = LanguageVersion.CSharp10, 13075LanguageVersion = LanguageVersion.CSharp10, 13578LanguageVersion = LanguageVersion.CSharp12, 13596LanguageVersion = LanguageVersion.CSharp12, 13621LanguageVersion = LanguageVersion.CSharp12, 13648LanguageVersion = LanguageVersion.CSharp12, 13681LanguageVersion = LanguageVersion.CSharp12, 13704LanguageVersion = LanguageVersion.CSharp12, 13734LanguageVersion = LanguageVersion.CSharp12, 13778LanguageVersion = LanguageVersion.CSharp12, 13815LanguageVersion = LanguageVersion.CSharp12, 13893LanguageVersion = LanguageVersion.CSharp12, 13933LanguageVersion = LanguageVersion.CSharp12, 13954LanguageVersion = LanguageVersion.CSharp12, 13975LanguageVersion = LanguageVersion.CSharp12, 13994LanguageVersion = LanguageVersion.CSharp12, 14013LanguageVersion = LanguageVersion.CSharp12, 14032LanguageVersion = LanguageVersion.CSharp12, 14053LanguageVersion = LanguageVersion.CSharp12, 14074LanguageVersion = LanguageVersion.CSharp12, 14095LanguageVersion = LanguageVersion.CSharp12, 14118LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryDiscardDesignation\RemoveUnnecessaryDiscardDesignationTests.cs (18)
54LanguageVersion = LanguageVersion.CSharp9, 76LanguageVersion = LanguageVersion.CSharp8, 109LanguageVersion = LanguageVersion.CSharp9, 136LanguageVersion = LanguageVersion.CSharp9, 169LanguageVersion = LanguageVersion.CSharp9, 202LanguageVersion = LanguageVersion.CSharp9, 235LanguageVersion = LanguageVersion.CSharp9, 256LanguageVersion = LanguageVersion.CSharp9, 289LanguageVersion = LanguageVersion.CSharp9, 328LanguageVersion = LanguageVersion.CSharp9, 352LanguageVersion = LanguageVersion.CSharp9, 377LanguageVersion = LanguageVersion.CSharp9, 430LanguageVersion = LanguageVersion.CSharp9, 461LanguageVersion = LanguageVersion.CSharp9, 493LanguageVersion = LanguageVersion.CSharp9, 528LanguageVersion = LanguageVersion.CSharp9, 563LanguageVersion = LanguageVersion.CSharp9, 601LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (5)
480LanguageVersion = LanguageVersion.CSharp10, 633LanguageVersion = LanguageVersion.CSharp10, 1030LanguageVersion = LanguageVersion.CSharp5, 1111LanguageVersion = LanguageVersion.CSharp5, 2105LanguageVersion = LanguageVersion.CSharp10,
src\Analyzers\CSharp\Tests\RemoveUnnecessaryLambdaExpression\RemoveUnnecessaryLambdaExpressionTests.cs (6)
28LanguageVersion version = LanguageVersion.CSharp12, 45LanguageVersion version = LanguageVersion.CSharp12, 66""", LanguageVersion.CSharp10); 123LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnreachableCode\RemoveUnreachableCodeTests.cs (7)
919LanguageVersion = LanguageVersion.CSharp9, 942LanguageVersion = LanguageVersion.CSharp9, 967LanguageVersion = LanguageVersion.CSharp9, 998LanguageVersion = LanguageVersion.CSharp9, 1026LanguageVersion = LanguageVersion.CSharp9, 1053LanguageVersion = LanguageVersion.CSharp9, 1078LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.cs (13)
446LanguageVersion = LanguageVersion.CSharp9, 474LanguageVersion = LanguageVersion.CSharp9, 493LanguageVersion = LanguageVersion.CSharp9, 520LanguageVersion = LanguageVersion.CSharp9, 1176LanguageVersion = LanguageVersion.CSharp9, 3124LanguageVersion = LanguageVersion.CSharp9, 3270LanguageVersion = LanguageVersion.CSharp13, 3368LanguageVersion = LanguageVersion.CSharp13, 3402LanguageVersion = LanguageVersion.CSharp13, 3425LanguageVersion = LanguageVersion.CSharp13, 3449LanguageVersion = LanguageVersion.CSharp13, 3480LanguageVersion = LanguageVersion.CSharp13, 3529LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1387""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (61)
961LanguageVersion = LanguageVersion.CSharp6, 2728""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2762""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2767[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 2843LanguageVersion = LanguageVersion.CSharp9, 3002""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3008[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 3071LanguageVersion = LanguageVersion.CSharp9, 3114""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3120[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 3208LanguageVersion = LanguageVersion.CSharp9, 3251""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3288""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 3374LanguageVersion = LanguageVersion.CSharp9, 5466""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7769""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8229""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8245""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8269""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8293""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8313""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8464""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8470[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 8551LanguageVersion = LanguageVersion.CSharp9, 8878""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8916""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8938parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8961parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 9118""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9124[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9156""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9182""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9217LanguageVersion = LanguageVersion.CSharp9, 9228[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9256[CombinatorialValues(LanguageVersion.CSharp8, LanguageVersion.CSharp9)] LanguageVersion languageVersion) 9300""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9339LanguageVersion = LanguageVersion.CSharp9, 9712LanguageVersion = LanguageVersion.CSharp9, 9750LanguageVersion = LanguageVersion.CSharp9, 9791LanguageVersion = LanguageVersion.CSharp9, 9832LanguageVersion = LanguageVersion.CSharp9, 9873LanguageVersion = LanguageVersion.CSharp9, 9914LanguageVersion = LanguageVersion.CSharp9, 9955LanguageVersion = LanguageVersion.CSharp11, 9997LanguageVersion = LanguageVersion.CSharp11, 10039LanguageVersion = LanguageVersion.CSharp11, 10062LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (25)
24private static readonly ImmutableArray<LanguageVersion> s_csharp7_1above = 25[LanguageVersion.CSharp7_1, LanguageVersion.Latest]; 27private static readonly ImmutableArray<LanguageVersion> s_csharp7below = 29LanguageVersion.CSharp7, 30LanguageVersion.CSharp6, 31LanguageVersion.CSharp5, 32LanguageVersion.CSharp4, 33LanguageVersion.CSharp3, 34LanguageVersion.CSharp2, 35LanguageVersion.CSharp1, 38private async Task TestWithLanguageVersionsAsync(string initialMarkup, string expectedMarkup, ImmutableArray<LanguageVersion> versions) 40foreach (var version in versions) 47private async Task TestMissingWithLanguageVersionsAsync(string initialMarkup, ImmutableArray<LanguageVersion> versions) 49foreach (var version in versions) 808""", [LanguageVersion.CSharp7_1, LanguageVersion.CSharp10, LanguageVersion.CSharp11, LanguageVersion.Latest]); 863""", [LanguageVersion.CSharp7_1, LanguageVersion.CSharp10, LanguageVersion.CSharp11, LanguageVersion.Latest]); 953""", [LanguageVersion.CSharp7_1]); 979""", [LanguageVersion.Latest]);
src\Analyzers\CSharp\Tests\TransposeRecordKeyword\TransposeRecordKeywordTests.cs (10)
27LanguageVersion = LanguageVersion.CSharp10 38LanguageVersion = LanguageVersion.CSharp10 49LanguageVersion = LanguageVersion.CSharp10 66LanguageVersion = LanguageVersion.CSharp10 83LanguageVersion = LanguageVersion.CSharp10 100LanguageVersion = LanguageVersion.CSharp10 115LanguageVersion = LanguageVersion.CSharp10 136LanguageVersion = LanguageVersion.CSharp10 161LanguageVersion = LanguageVersion.CSharp10 182LanguageVersion = LanguageVersion.CSharp10
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (111)
33LanguageVersion expected, 77LanguageVersion.CSharp8, 78new CSharpParseOptions(LanguageVersion.CSharp7_2)); 91LanguageVersion.CSharp8, 92new CSharpParseOptions(LanguageVersion.CSharp7)); 108LanguageVersion.CSharp7, 109new CSharpParseOptions(LanguageVersion.CSharp6)); 125LanguageVersion.CSharp6, 126new CSharpParseOptions(LanguageVersion.CSharp5)); 142LanguageVersion.CSharp5, 143new CSharpParseOptions(LanguageVersion.CSharp4)); 153#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 156LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 157new CSharpParseOptions(LanguageVersion.CSharp7)); 190LanguageVersion.CSharp7_1, 191new CSharpParseOptions(LanguageVersion.CSharp7)); 201#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 204LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 205new CSharpParseOptions(LanguageVersion.CSharp7_1)); 218LanguageVersion.CSharp7_1, 219new CSharpParseOptions(LanguageVersion.CSharp7)); 235LanguageVersion.CSharp7_2, 236new CSharpParseOptions(LanguageVersion.CSharp7_1)); 254LanguageVersion.CSharp7_1, 255new CSharpParseOptions(LanguageVersion.CSharp7)); 266#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 269LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 270new CSharpParseOptions(LanguageVersion.CSharp7_2)); 285LanguageVersion.CSharp7_3, 286new CSharpParseOptions(LanguageVersion.CSharp7_2)); 298LanguageVersion.CSharp7_3, 299new CSharpParseOptions(LanguageVersion.CSharp7_2)); 311LanguageVersion.CSharp7_3, 312new CSharpParseOptions(LanguageVersion.CSharp7_2)); 324LanguageVersion.CSharp7_3, 325new CSharpParseOptions(LanguageVersion.CSharp7_2)); 337#error version:[|{{LanguageVersion.Latest.MapSpecifiedToEffectiveVersion().ToDisplayString()}}|] 340LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 341new CSharpParseOptions(LanguageVersion.CSharp7_3)); 351#error version:[|{{LanguageVersion.CSharp8.ToDisplayString()}}|] 354LanguageVersion.Latest.MapSpecifiedToEffectiveVersion(), 355new CSharpParseOptions(LanguageVersion.CSharp7_3)); 371expected: LanguageVersion.CSharp8, 372new CSharpParseOptions(LanguageVersion.CSharp7_3)); 401LanguageVersion.CSharp7, 428LanguageVersion.CSharp8, 459LanguageVersion.CSharp8, 485LanguageVersion.CSharp9, 610var defaultVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion().ToDisplayString(); 664var defaultEffectiveVersion = LanguageVersion.Default.MapSpecifiedToEffectiveVersion().ToDisplayString(); 702LanguageVersion.CSharp9, 703new CSharpParseOptions(LanguageVersion.CSharp8)); 715LanguageVersion.CSharp7_3, 716new CSharpParseOptions(LanguageVersion.CSharp7)); 748LanguageVersion.CSharp7_3, 749new CSharpParseOptions(LanguageVersion.CSharp7)); 777LanguageVersion.CSharp7_3, 778new CSharpParseOptions(LanguageVersion.CSharp7)); 811LanguageVersion.CSharp7_3, 812new CSharpParseOptions(LanguageVersion.CSharp7)); 848expected: LanguageVersion.CSharp8, 849new CSharpParseOptions(LanguageVersion.CSharp7_3)); 877new CSharpParseOptions(LanguageVersion.CSharp7_3)); 890LanguageVersion.CSharp8, 891new CSharpParseOptions(LanguageVersion.CSharp7_3)); 904LanguageVersion.CSharp8, 905new CSharpParseOptions(LanguageVersion.CSharp7_3)); 918LanguageVersion.CSharp8, 919new CSharpParseOptions(LanguageVersion.CSharp7_3)); 931LanguageVersion.CSharp8, 932new CSharpParseOptions(LanguageVersion.CSharp7_3)); 964LanguageVersion.CSharp8, 965new CSharpParseOptions(LanguageVersion.CSharp7_3)); 993LanguageVersion.CSharp8, 994new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1027LanguageVersion.CSharp8, 1028new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1064expected: LanguageVersion.CSharp9, 1065new CSharpParseOptions(LanguageVersion.CSharp8)); 1090expected: LanguageVersion.CSharp10, 1091new CSharpParseOptions(LanguageVersion.CSharp9)); 1101LanguageVersion.CSharp12, 1102new CSharpParseOptions(LanguageVersion.CSharp11)); 1112LanguageVersion.CSharp12, 1113new CSharpParseOptions(LanguageVersion.CSharp11)); 1123LanguageVersion.CSharp12, 1124new CSharpParseOptions(LanguageVersion.CSharp11)); 1134LanguageVersion.CSharp12, 1135new CSharpParseOptions(LanguageVersion.CSharp11)); 1145LanguageVersion.CSharp12, 1146new CSharpParseOptions(LanguageVersion.CSharp11)); 1156LanguageVersion.CSharp12, 1157new CSharpParseOptions(LanguageVersion.CSharp11)); 1169LanguageVersion.CSharp9, 1170new CSharpParseOptions(LanguageVersion.CSharp8)); 1179LanguageVersion.CSharp10, 1180new CSharpParseOptions(LanguageVersion.CSharp9)); 1198expected: LanguageVersion.CSharp10, 1199new CSharpParseOptions(LanguageVersion.CSharp9)); 1214expected: LanguageVersion.CSharp9, 1215new CSharpParseOptions(LanguageVersion.CSharp8)); 1232expected: LanguageVersion.CSharp11, 1233new CSharpParseOptions(LanguageVersion.CSharp8)); 1246expected: LanguageVersion.CSharp11, 1247new CSharpParseOptions(LanguageVersion.CSharp10)); 1260expected: LanguageVersion.CSharp11, 1261new CSharpParseOptions(LanguageVersion.CSharp10)); 1274expected: LanguageVersion.CSharp11, 1275new CSharpParseOptions(LanguageVersion.CSharp10)); 1291expected: LanguageVersion.CSharp12, 1292new CSharpParseOptions(LanguageVersion.CSharp11));
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\UseCoalesceExpression\UseCoalesceExpressionForIfNullStatementCheckTests.cs (3)
181LanguageVersion = LanguageVersion.CSharp9, 251LanguageVersion = LanguageVersion.CSharp9, 448LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForArrayTests.cs (26)
35LanguageVersion = LanguageVersion.CSharp11, 56LanguageVersion = LanguageVersion.CSharp12, 77LanguageVersion = LanguageVersion.CSharp12, 98LanguageVersion = LanguageVersion.CSharp12, 123LanguageVersion = LanguageVersion.CSharp12, 148LanguageVersion = LanguageVersion.CSharp12, 169LanguageVersion = LanguageVersion.CSharp12, 190LanguageVersion = LanguageVersion.CSharp12, 205LanguageVersion = LanguageVersion.CSharp12, 230LanguageVersion = LanguageVersion.CSharp12, 251LanguageVersion = LanguageVersion.CSharp12, 278LanguageVersion = LanguageVersion.CSharp12, 299LanguageVersion = LanguageVersion.CSharp12, 320LanguageVersion = LanguageVersion.CSharp12, 341LanguageVersion = LanguageVersion.CSharp12, 356LanguageVersion = LanguageVersion.CSharp12, 371LanguageVersion = LanguageVersion.CSharp12, 386LanguageVersion = LanguageVersion.CSharp12, 407LanguageVersion = LanguageVersion.CSharp12, 422LanguageVersion = LanguageVersion.CSharp12, 447LanguageVersion = LanguageVersion.CSharp12, 474LanguageVersion = LanguageVersion.CSharp12, 489LanguageVersion = LanguageVersion.CSharp12, 510LanguageVersion = LanguageVersion.CSharp12, 529LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForBuilderTests.cs (44)
84LanguageVersion = LanguageVersion.CSharp11, 107LanguageVersion = LanguageVersion.CSharp12, 141LanguageVersion = LanguageVersion.CSharp12, 175LanguageVersion = LanguageVersion.CSharp12, 199LanguageVersion = LanguageVersion.CSharp12, 237LanguageVersion = LanguageVersion.CSharp12, 275LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 351LanguageVersion = LanguageVersion.CSharp12, 377LanguageVersion = LanguageVersion.CSharp12, 401LanguageVersion = LanguageVersion.CSharp12, 442LanguageVersion = LanguageVersion.CSharp12, 485LanguageVersion = LanguageVersion.CSharp12, 515LanguageVersion = LanguageVersion.CSharp12, 545LanguageVersion = LanguageVersion.CSharp12, 592LanguageVersion = LanguageVersion.CSharp12, 639LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 726LanguageVersion = LanguageVersion.CSharp12, 768LanguageVersion = LanguageVersion.CSharp12, 810LanguageVersion = LanguageVersion.CSharp12, 856LanguageVersion = LanguageVersion.CSharp12, 894LanguageVersion = LanguageVersion.CSharp12, 932LanguageVersion = LanguageVersion.CSharp12, 970LanguageVersion = LanguageVersion.CSharp12, 995LanguageVersion = LanguageVersion.CSharp12, 1034LanguageVersion = LanguageVersion.CSharp12, 1072LanguageVersion = LanguageVersion.CSharp12, 1110LanguageVersion = LanguageVersion.CSharp12, 1148LanguageVersion = LanguageVersion.CSharp12, 1186LanguageVersion = LanguageVersion.CSharp12, 1212LanguageVersion = LanguageVersion.CSharp12, 1238LanguageVersion = LanguageVersion.CSharp12, 1278LanguageVersion = LanguageVersion.CSharp12, 1317LanguageVersion = LanguageVersion.CSharp12, 1360LanguageVersion = LanguageVersion.CSharp12, 1383LanguageVersion = LanguageVersion.CSharp12, 1405LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1482LanguageVersion = LanguageVersion.CSharp12, 1521LanguageVersion = LanguageVersion.CSharp12, 1559LanguageVersion = LanguageVersion.CSharp12, 1584LanguageVersion = LanguageVersion.CSharp12, 1625LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForCreateTests.cs (52)
77LanguageVersion = LanguageVersion.CSharp11, 99LanguageVersion = LanguageVersion.CSharp12, 121LanguageVersion = LanguageVersion.CSharp12, 149LanguageVersion = LanguageVersion.CSharp12, 170LanguageVersion = LanguageVersion.CSharp12, 192LanguageVersion = LanguageVersion.CSharp12, 214LanguageVersion = LanguageVersion.CSharp12, 236LanguageVersion = LanguageVersion.CSharp12, 258LanguageVersion = LanguageVersion.CSharp12, 280LanguageVersion = LanguageVersion.CSharp12, 296LanguageVersion = LanguageVersion.CSharp12, 318LanguageVersion = LanguageVersion.CSharp12, 340LanguageVersion = LanguageVersion.CSharp12, 362LanguageVersion = LanguageVersion.CSharp12, 378LanguageVersion = LanguageVersion.CSharp12, 394LanguageVersion = LanguageVersion.CSharp12, 416LanguageVersion = LanguageVersion.CSharp12, 438LanguageVersion = LanguageVersion.CSharp12, 460LanguageVersion = LanguageVersion.CSharp12, 476LanguageVersion = LanguageVersion.CSharp12, 508LanguageVersion = LanguageVersion.CSharp12, 530LanguageVersion = LanguageVersion.CSharp12, 552LanguageVersion = LanguageVersion.CSharp12, 574LanguageVersion = LanguageVersion.CSharp12, 596LanguageVersion = LanguageVersion.CSharp12, 614LanguageVersion = LanguageVersion.CSharp12, 632LanguageVersion = LanguageVersion.CSharp12, 658LanguageVersion = LanguageVersion.CSharp12, 684LanguageVersion = LanguageVersion.CSharp12, 710LanguageVersion = LanguageVersion.CSharp12, 736LanguageVersion = LanguageVersion.CSharp12, 762LanguageVersion = LanguageVersion.CSharp12, 788LanguageVersion = LanguageVersion.CSharp12, 807LanguageVersion = LanguageVersion.CSharp12, 829LanguageVersion = LanguageVersion.CSharp12, 853LanguageVersion = LanguageVersion.CSharp12, 884LanguageVersion = LanguageVersion.CSharp12, 906LanguageVersion = LanguageVersion.CSharp12, 940LanguageVersion = LanguageVersion.CSharp12, 962LanguageVersion = LanguageVersion.CSharp12, 996LanguageVersion = LanguageVersion.CSharp12, 1012LanguageVersion = LanguageVersion.CSharp12, 1040LanguageVersion = LanguageVersion.CSharp12, 1078LanguageVersion = LanguageVersion.CSharp12, 1115LanguageVersion = LanguageVersion.CSharp12, 1156LanguageVersion = LanguageVersion.CSharp12, 1181LanguageVersion = LanguageVersion.CSharp12, 1206LanguageVersion = LanguageVersion.CSharp12, 1240LanguageVersion = LanguageVersion.CSharp12, 1266LanguageVersion = LanguageVersion.CSharp12, 1284LanguageVersion = LanguageVersion.CSharp12, 1324LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForEmptyTests.cs (49)
51LanguageVersion = LanguageVersion.CSharp12, 82LanguageVersion = LanguageVersion.CSharp12, 113LanguageVersion = LanguageVersion.CSharp12, 142LanguageVersion = LanguageVersion.CSharp12, 161LanguageVersion = LanguageVersion.CSharp12, 198LanguageVersion = LanguageVersion.CSharp12, 219LanguageVersion = LanguageVersion.CSharp12, 254LanguageVersion = LanguageVersion.CSharp12, 287LanguageVersion = LanguageVersion.CSharp12, 320LanguageVersion = LanguageVersion.CSharp12, 353LanguageVersion = LanguageVersion.CSharp12, 386LanguageVersion = LanguageVersion.CSharp12, 417LanguageVersion = LanguageVersion.CSharp12, 438LanguageVersion = LanguageVersion.CSharp12, 471LanguageVersion = LanguageVersion.CSharp12, 496LanguageVersion = LanguageVersion.CSharp12, 553LanguageVersion = LanguageVersion.CSharp12, 621LanguageVersion = LanguageVersion.CSharp12, 689LanguageVersion = LanguageVersion.CSharp12, 721LanguageVersion = LanguageVersion.CSharp12, 742LanguageVersion = LanguageVersion.CSharp12, 776LanguageVersion = LanguageVersion.CSharp12, 798LanguageVersion = LanguageVersion.CSharp12, 832LanguageVersion = LanguageVersion.CSharp12, 865LanguageVersion = LanguageVersion.CSharp12, 900LanguageVersion = LanguageVersion.CSharp12, 951LanguageVersion = LanguageVersion.CSharp12, 989LanguageVersion = LanguageVersion.CSharp12, 1041LanguageVersion = LanguageVersion.CSharp12, 1094LanguageVersion = LanguageVersion.CSharp12, 1149LanguageVersion = LanguageVersion.CSharp12, 1187LanguageVersion = LanguageVersion.CSharp12, 1244LanguageVersion = LanguageVersion.CSharp12, 1268LanguageVersion = LanguageVersion.CSharp12, 1288LanguageVersion = LanguageVersion.CSharp12, 1315LanguageVersion = LanguageVersion.CSharp12, 1352LanguageVersion = LanguageVersion.CSharp12, 1382LanguageVersion = LanguageVersion.CSharp12, 1412LanguageVersion = LanguageVersion.CSharp12, 1442LanguageVersion = LanguageVersion.CSharp12, 1472LanguageVersion = LanguageVersion.CSharp12, 1508LanguageVersion = LanguageVersion.CSharp12, 1548LanguageVersion = LanguageVersion.CSharp12, 1586LanguageVersion = LanguageVersion.CSharp12, 1609LanguageVersion = LanguageVersion.CSharp12, 1632LanguageVersion = LanguageVersion.CSharp12, 1669LanguageVersion = LanguageVersion.CSharp12, 1694LanguageVersion = LanguageVersion.CSharp12, 1716LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForFluentTests.cs (92)
39LanguageVersion = LanguageVersion.CSharp11, 73LanguageVersion = LanguageVersion.CSharp12, 107LanguageVersion = LanguageVersion.CSharp12, 141LanguageVersion = LanguageVersion.CSharp12, 164LanguageVersion = LanguageVersion.CSharp12, 198LanguageVersion = LanguageVersion.CSharp12, 232LanguageVersion = LanguageVersion.CSharp12, 254LanguageVersion = LanguageVersion.CSharp12, 290LanguageVersion = LanguageVersion.CSharp12, 326LanguageVersion = LanguageVersion.CSharp12, 362LanguageVersion = LanguageVersion.CSharp12, 398LanguageVersion = LanguageVersion.CSharp12, 434LanguageVersion = LanguageVersion.CSharp12, 470LanguageVersion = LanguageVersion.CSharp12, 506LanguageVersion = LanguageVersion.CSharp12, 542LanguageVersion = LanguageVersion.CSharp12, 578LanguageVersion = LanguageVersion.CSharp12, 614LanguageVersion = LanguageVersion.CSharp12, 650LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 709LanguageVersion = LanguageVersion.CSharp12, 732LanguageVersion = LanguageVersion.CSharp12, 755LanguageVersion = LanguageVersion.CSharp12, 795LanguageVersion = LanguageVersion.CSharp12, 831LanguageVersion = LanguageVersion.CSharp12, 854LanguageVersion = LanguageVersion.CSharp12, 898LanguageVersion = LanguageVersion.CSharp12, 934LanguageVersion = LanguageVersion.CSharp12, 957LanguageVersion = LanguageVersion.CSharp12, 993LanguageVersion = LanguageVersion.CSharp12, 1029LanguageVersion = LanguageVersion.CSharp12, 1071LanguageVersion = LanguageVersion.CSharp12, 1118LanguageVersion = LanguageVersion.CSharp12, 1160LanguageVersion = LanguageVersion.CSharp12, 1207LanguageVersion = LanguageVersion.CSharp12, 1233LanguageVersion = LanguageVersion.CSharp12, 1259LanguageVersion = LanguageVersion.CSharp12, 1285LanguageVersion = LanguageVersion.CSharp12, 1310LanguageVersion = LanguageVersion.CSharp12, 1335LanguageVersion = LanguageVersion.CSharp12, 1371LanguageVersion = LanguageVersion.CSharp12, 1407LanguageVersion = LanguageVersion.CSharp12, 1443LanguageVersion = LanguageVersion.CSharp12, 1481LanguageVersion = LanguageVersion.CSharp12, 1519LanguageVersion = LanguageVersion.CSharp12, 1543LanguageVersion = LanguageVersion.CSharp12, 1570LanguageVersion = LanguageVersion.CSharp12, 1608LanguageVersion = LanguageVersion.CSharp12, 1646LanguageVersion = LanguageVersion.CSharp12, 1684LanguageVersion = LanguageVersion.CSharp12, 1728LanguageVersion = LanguageVersion.CSharp12, 1772LanguageVersion = LanguageVersion.CSharp12, 1810LanguageVersion = LanguageVersion.CSharp12, 1848LanguageVersion = LanguageVersion.CSharp12, 1894LanguageVersion = LanguageVersion.CSharp12, 1939LanguageVersion = LanguageVersion.CSharp12, 1973LanguageVersion = LanguageVersion.CSharp12, 1995LanguageVersion = LanguageVersion.CSharp12, 2031LanguageVersion = LanguageVersion.CSharp12, 2079LanguageVersion = LanguageVersion.CSharp12, 2114LanguageVersion = LanguageVersion.CSharp12, 2149LanguageVersion = LanguageVersion.CSharp12, 2183LanguageVersion = LanguageVersion.CSharp12, 2206LanguageVersion = LanguageVersion.CSharp12, 2242LanguageVersion = LanguageVersion.CSharp12, 2265LanguageVersion = LanguageVersion.CSharp12, 2301LanguageVersion = LanguageVersion.CSharp12, 2324LanguageVersion = LanguageVersion.CSharp12, 2360LanguageVersion = LanguageVersion.CSharp12, 2398LanguageVersion = LanguageVersion.CSharp12, 2432LanguageVersion = LanguageVersion.CSharp12, 2466LanguageVersion = LanguageVersion.CSharp12, 2501LanguageVersion = LanguageVersion.CSharp12, 2536LanguageVersion = LanguageVersion.CSharp12, 2573LanguageVersion = LanguageVersion.CSharp12, 2610LanguageVersion = LanguageVersion.CSharp12, 2650LanguageVersion = LanguageVersion.CSharp12, 2674LanguageVersion = LanguageVersion.CSharp12, 2698LanguageVersion = LanguageVersion.CSharp12, 2726LanguageVersion = LanguageVersion.CSharp12, 2777LanguageVersion = LanguageVersion.CSharp12, 2810LanguageVersion = LanguageVersion.CSharp12, 2832LanguageVersion = LanguageVersion.CSharp12, 2872LanguageVersion = LanguageVersion.CSharp12, 2908LanguageVersion = LanguageVersion.CSharp12, 2935LanguageVersion = LanguageVersion.CSharp12, 2978LanguageVersion = LanguageVersion.CSharp12, 3012LanguageVersion = LanguageVersion.CSharp12, 3046LanguageVersion = LanguageVersion.CSharp12, 3080LanguageVersion = LanguageVersion.CSharp12, 3114LanguageVersion = LanguageVersion.CSharp12, 3150LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForNewTests.cs (2)
55LanguageVersion = LanguageVersion.CSharp12, 93LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForStackAllocTests.cs (56)
38LanguageVersion = LanguageVersion.CSharp11, 59LanguageVersion = LanguageVersion.CSharp11, 80LanguageVersion = LanguageVersion.CSharp12, 101LanguageVersion = LanguageVersion.CSharp12, 133LanguageVersion = LanguageVersion.CSharp12, 165LanguageVersion = LanguageVersion.CSharp12, 197LanguageVersion = LanguageVersion.CSharp12, 229LanguageVersion = LanguageVersion.CSharp12, 250LanguageVersion = LanguageVersion.CSharp12, 271LanguageVersion = LanguageVersion.CSharp12, 292LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 347LanguageVersion = LanguageVersion.CSharp12, 368LanguageVersion = LanguageVersion.CSharp12, 389LanguageVersion = LanguageVersion.CSharp12, 410LanguageVersion = LanguageVersion.CSharp12, 431LanguageVersion = LanguageVersion.CSharp12, 467LanguageVersion = LanguageVersion.CSharp12, 503LanguageVersion = LanguageVersion.CSharp12, 535LanguageVersion = LanguageVersion.CSharp12, 567LanguageVersion = LanguageVersion.CSharp12, 589LanguageVersion = LanguageVersion.CSharp12, 621LanguageVersion = LanguageVersion.CSharp12, 642LanguageVersion = LanguageVersion.CSharp12, 674LanguageVersion = LanguageVersion.CSharp12, 695LanguageVersion = LanguageVersion.CSharp12, 717LanguageVersion = LanguageVersion.CSharp12, 741LanguageVersion = LanguageVersion.CSharp12, 763LanguageVersion = LanguageVersion.CSharp12, 785LanguageVersion = LanguageVersion.CSharp12, 809LanguageVersion = LanguageVersion.CSharp12, 833LanguageVersion = LanguageVersion.CSharp12, 855LanguageVersion = LanguageVersion.CSharp12, 877LanguageVersion = LanguageVersion.CSharp12, 900LanguageVersion = LanguageVersion.CSharp12, 933LanguageVersion = LanguageVersion.CSharp12, 968LanguageVersion = LanguageVersion.CSharp12, 1002LanguageVersion = LanguageVersion.CSharp12, 1038LanguageVersion = LanguageVersion.CSharp12, 1061LanguageVersion = LanguageVersion.CSharp12, 1085LanguageVersion = LanguageVersion.CSharp12, 1111LanguageVersion = LanguageVersion.CSharp12, 1151LanguageVersion = LanguageVersion.CSharp12, 1191LanguageVersion = LanguageVersion.CSharp12, 1229LanguageVersion = LanguageVersion.CSharp12, 1269LanguageVersion = LanguageVersion.CSharp12, 1305LanguageVersion = LanguageVersion.CSharp12, 1343LanguageVersion = LanguageVersion.CSharp12, 1381LanguageVersion = LanguageVersion.CSharp12, 1421LanguageVersion = LanguageVersion.CSharp12, 1457LanguageVersion = LanguageVersion.CSharp12, 1495LanguageVersion = LanguageVersion.CSharp12, 1533LanguageVersion = LanguageVersion.CSharp12, 1575LanguageVersion = LanguageVersion.CSharp12, 1595LanguageVersion = LanguageVersion.CSharp12, 1631LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionInitializer\UseCollectionInitializerTests.cs (10)
26LanguageVersion languageVersion = LanguageVersion.CSharp11) 40private static async Task TestMissingInRegularAndScriptAsync(string testCode, LanguageVersion? languageVersion = null) 343""", LanguageVersion.CSharp5); 603""", LanguageVersion.CSharp2); 1682""", OutputKind.ConsoleApplication, LanguageVersion.CSharp12); 1714""", languageVersion: LanguageVersion.CSharp12); 1748LanguageVersion = LanguageVersion.CSharp12, 1785LanguageVersion = LanguageVersion.CSharp12, 1826LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseCollectionInitializer\UseCollectionInitializerTests_CollectionExpression.cs (24)
31LanguageVersion = LanguageVersion.CSharp12, 375LanguageVersion = LanguageVersion.CSharp12, 798LanguageVersion = LanguageVersion.CSharp12, 823LanguageVersion = LanguageVersion.CSharp12, 1941LanguageVersion = LanguageVersion.CSharp12, 4385LanguageVersion = LanguageVersion.CSharp12, 5346LanguageVersion = LanguageVersion.CSharp12, 5386LanguageVersion = LanguageVersion.CSharp12, 5423LanguageVersion = LanguageVersion.CSharp12, 5457LanguageVersion = LanguageVersion.CSharp12, 5491LanguageVersion = LanguageVersion.CSharp12, 5525LanguageVersion = LanguageVersion.CSharp12, 5569LanguageVersion = LanguageVersion.CSharp12, 5603LanguageVersion = LanguageVersion.CSharp12, 5637LanguageVersion = LanguageVersion.CSharp12, 5681LanguageVersion = LanguageVersion.CSharp12, 5705LanguageVersion = LanguageVersion.CSharp12, 5743LanguageVersion = LanguageVersion.CSharp12, 5777LanguageVersion = LanguageVersion.CSharp12, 5811LanguageVersion = LanguageVersion.CSharp12, 5865LanguageVersion = LanguageVersion.CSharp12, 5887LanguageVersion = LanguageVersion.CSharp13, 5908LanguageVersion = LanguageVersion.CSharp13, 5940LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseCompoundAssignment\UseCompoundAssignmentTests.cs (4)
266LanguageVersion = LanguageVersion.CSharp8 286LanguageVersion = LanguageVersion.CSharp7_3 307LanguageVersion = LanguageVersion.CSharp8 959LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseCompoundAssignment\UseCompoundCoalesceAssignmentTests.cs (7)
31private static async Task TestMissingAsync(string testCode, LanguageVersion languageVersion = LanguageVersion.CSharp8) 71""", LanguageVersion.CSharp7_3); 297""", LanguageVersion.CSharp7_3); 957""", LanguageVersion.CSharp12); 977""", LanguageVersion.CSharp12); 1000""", LanguageVersion.CSharp12);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForAssignmentTests.cs (13)
26LanguageVersion languageVersion = LanguageVersion.CSharp8, 42LanguageVersion languageVersion = LanguageVersion.CSharp8, 197""", LanguageVersion.CSharp6); 589""", LanguageVersion.Latest); 987""", LanguageVersion.CSharp8, PreferImplicitTypeAlways); 1019""", LanguageVersion.CSharp9, options: PreferImplicitTypeAlways); 1179""", LanguageVersion.CSharp8, PreferImplicitTypeAlways); 1211""", LanguageVersion.CSharp9, options: PreferImplicitTypeAlways); 1903""", LanguageVersion.CSharp9); 1949""", LanguageVersion.CSharp9, equivalenceKey: nameof(AnalyzersResources.Simplify_check)); 2141LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (15)
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))); 977[InlineData(LanguageVersion.CSharp8, "(string)null")] 978[InlineData(LanguageVersion.CSharp9, "null")] 979public async Task TestConversion2_Throw1(LanguageVersion languageVersion, string expectedFalseExpression) 1043[InlineData(LanguageVersion.CSharp8, "(string)null")] 1044[InlineData(LanguageVersion.CSharp9, "null")] 1045public async Task TestConversion3(LanguageVersion languageVersion, string expectedFalseExpression) 1078[InlineData(LanguageVersion.CSharp8, "(string)null")] 1079[InlineData(LanguageVersion.CSharp9, "null")] 1080public async Task TestConversion3_Throw1(LanguageVersion languageVersion, string expectedFalseExpression) 1113[InlineData(LanguageVersion.CSharp8, "(string)null")] 1114[InlineData(LanguageVersion.CSharp9, "null")] 1115public async Task TestConversion3_Throw2(LanguageVersion languageVersion, string expectedTrue)
src\Analyzers\CSharp\Tests\UseDeconstruction\UseDeconstructionTests.cs (3)
539LanguageVersion = LanguageVersion.CSharp7_1 877LanguageVersion = LanguageVersion.CSharp9 912LanguageVersion = LanguageVersion.CSharp9
src\Analyzers\CSharp\Tests\UseDefaultLiteral\UseDefaultLiteralTests.cs (30)
37LanguageVersion = LanguageVersion.CSharp7 62LanguageVersion = LanguageVersion.CSharp7_1 89LanguageVersion = LanguageVersion.CSharp7_1 116LanguageVersion = LanguageVersion.CSharp7_1 136LanguageVersion = LanguageVersion.CSharp7_1 167LanguageVersion = LanguageVersion.CSharp7_1 189LanguageVersion = LanguageVersion.CSharp7_1 216LanguageVersion = LanguageVersion.CSharp7_1 236LanguageVersion = LanguageVersion.CSharp7_1 256LanguageVersion = LanguageVersion.CSharp7_1 287LanguageVersion = LanguageVersion.CSharp7_1 310LanguageVersion = LanguageVersion.CSharp7_1 337LanguageVersion = LanguageVersion.CSharp7_1, 366LanguageVersion = LanguageVersion.CSharp7_1, 397LanguageVersion = LanguageVersion.CSharp7_1 424LanguageVersion = LanguageVersion.CSharp7_1 453LanguageVersion = LanguageVersion.CSharp7_1 479LanguageVersion = LanguageVersion.CSharp7_1 505LanguageVersion = LanguageVersion.CSharp7_1 538LanguageVersion = LanguageVersion.CSharp7_1 561LanguageVersion = LanguageVersion.CSharp7_1 584LanguageVersion = LanguageVersion.CSharp7_1 617LanguageVersion = LanguageVersion.CSharp7_1 640LanguageVersion = LanguageVersion.CSharp7_1 663LanguageVersion = LanguageVersion.CSharp7_1 696LanguageVersion = LanguageVersion.CSharp7_1 729LanguageVersion = LanguageVersion.CSharp7_1 749LanguageVersion = LanguageVersion.CSharp7_1 769LanguageVersion = LanguageVersion.CSharp7_1 796LanguageVersion = LanguageVersion.CSharp7_1
src\Analyzers\CSharp\Tests\UseExplicitArrayInExpressionTree\UseExplicitArrayInExpressionTreeTests.cs (16)
56LanguageVersion = LanguageVersion.CSharp13, 94LanguageVersion = LanguageVersion.CSharp13, 117LanguageVersion = LanguageVersion.CSharp13, 140LanguageVersion = LanguageVersion.CSharp13, 163LanguageVersion = LanguageVersion.CSharp13, 201LanguageVersion = LanguageVersion.CSharp13, 239LanguageVersion = LanguageVersion.CSharp13, 277LanguageVersion = LanguageVersion.CSharp13, 315LanguageVersion = LanguageVersion.CSharp13, 353LanguageVersion = LanguageVersion.CSharp13, 391LanguageVersion = LanguageVersion.CSharp13, 429LanguageVersion = LanguageVersion.CSharp13, 473LanguageVersion = LanguageVersion.CSharp13, 517LanguageVersion = LanguageVersion.CSharp13, 561LanguageVersion = LanguageVersion.CSharp13, 605LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseExplicitTupleName\UseExplicitTupleNameTests.cs (1)
299LanguageVersion = LanguageVersion.CSharp11
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForAccessorsAnalyzerTests.cs (15)
29LanguageVersion version = LanguageVersion.CSharp8) 33ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 51LanguageVersion version = LanguageVersion.CSharp8) 55ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 71LanguageVersion version = LanguageVersion.CSharp8) 75ReferenceAssemblies = version == LanguageVersion.CSharp9 ? ReferenceAssemblies.Net.Net50 : ReferenceAssemblies.Default, 269await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp9); 308LanguageVersion = LanguageVersion.CSharp9, 505await TestWithUseBlockBodyIncludingPropertiesAndIndexers(code, fixedCode, LanguageVersion.CSharp9); 888LanguageVersion = LanguageVersion.CSharp9, 921await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 955await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForConstructorsAnalyzerTests.cs (4)
24private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 273await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 302await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForLocalFunctionsAnalyzerTests.cs (2)
912LanguageVersion = LanguageVersion.CSharp9, 941LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForMethodsAnalyzerTests.cs (7)
25private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 862await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp5); 875await TestWithUseExpressionBody(code, code, LanguageVersion.CSharp6); 895await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 909await TestWithUseExpressionBody(code, code, LanguageVersion.CSharp6); 941await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseExpressionBody\UseExpressionBodyForPropertiesAnalyzerTests.cs (4)
25private static async Task TestWithUseExpressionBody(string code, string fixedCode, LanguageVersion version = LanguageVersion.CSharp8) 522await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6); 557await TestWithUseExpressionBody(code, fixedCode, LanguageVersion.CSharp6);
src\Analyzers\CSharp\Tests\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationTests.cs (44)
35LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp8, 57LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 78LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 99LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 120LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 135LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 162LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 177LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 192LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 213LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 240LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 262LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 297LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 324LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 345LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 366LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 387LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 408LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 429LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 444LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 465LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 486LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 501LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 517LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 536LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 559LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 582LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 607LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 642LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 665LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 688LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 717LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 732LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 756LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 781LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 806LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 831LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 848LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 865LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 890LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 915LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 932LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 949LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9, 974LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
3367""", new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), options: ImplicitTypeEverywhere()));
src\Analyzers\CSharp\Tests\UseIndexOrRangeOperator\UseIndexOperatorTests.cs (3)
41LanguageVersion = LanguageVersion.CSharp7, 533LanguageVersion = LanguageVersion.CSharp8, 570LanguageVersion = LanguageVersion.CSharp8,
src\Analyzers\CSharp\Tests\UseIndexOrRangeOperator\UseRangeOperatorTests.cs (4)
41LanguageVersion = LanguageVersion.CSharp7, 100LanguageVersion = LanguageVersion.CSharp8, 137LanguageVersion = LanguageVersion.CSharp8, 400LanguageVersion = LanguageVersion.CSharp7,
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\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (6)
49""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 64""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 88""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 114""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 129""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 144""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp8)));
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\UseIsNullCheck\UseNullCheckOverTypeCheckDiagnosticAnalyzerTests.cs (3)
20private static async Task VerifyAsync(string source, string fixedSource, LanguageVersion languageVersion) 31=> await VerifyAsync(source, fixedSource, LanguageVersion.CSharp9); 34=> await VerifyAsync(source, fixedSource, LanguageVersion.CSharp8);
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\UseNullPropagation\UseNullPropagationTests.cs (5)
33LanguageVersion = LanguageVersion.CSharp9, 41private static async Task TestMissingInRegularAndScriptAsync(string testCode, LanguageVersion languageVersion = LanguageVersion.CSharp9) 298""", LanguageVersion.CSharp5); 316""", LanguageVersion.CSharp5);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (28)
25LanguageVersion? languageVersion = null) 77LanguageVersion = LanguageVersion.CSharp12, 184LanguageVersion = LanguageVersion.CSharp12, 249LanguageVersion = LanguageVersion.CSharp12, 313LanguageVersion = LanguageVersion.CSharp12, 358LanguageVersion = LanguageVersion.CSharp12, 405LanguageVersion = LanguageVersion.CSharp12, 452LanguageVersion = LanguageVersion.CSharp12, 498LanguageVersion = LanguageVersion.CSharp12, 547LanguageVersion = LanguageVersion.CSharp12, 598LanguageVersion = LanguageVersion.CSharp12, 618""", LanguageVersion.CSharp2); 679LanguageVersion = LanguageVersion.CSharp12, 735LanguageVersion = LanguageVersion.CSharp12, 792LanguageVersion = LanguageVersion.CSharp12, 837LanguageVersion = LanguageVersion.CSharp12, 889LanguageVersion = LanguageVersion.CSharp12, 990LanguageVersion = LanguageVersion.CSharp12, 1043LanguageVersion = LanguageVersion.CSharp12, 1155LanguageVersion = LanguageVersion.CSharp12, 1220LanguageVersion = LanguageVersion.CSharp12, 1257LanguageVersion = LanguageVersion.CSharp12, 1339LanguageVersion = LanguageVersion.CSharp12, 1412LanguageVersion = LanguageVersion.CSharp12, 1455LanguageVersion = LanguageVersion.CSharp12, 1502LanguageVersion = LanguageVersion.CSharp12, 1545LanguageVersion = LanguageVersion.CSharp12, 1592LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndMemberAccessTests.cs (34)
70LanguageVersion = LanguageVersion.CSharp7, 91LanguageVersion = LanguageVersion.CSharp7, 110LanguageVersion = LanguageVersion.CSharp7, 134LanguageVersion = LanguageVersion.CSharp7, 155LanguageVersion = LanguageVersion.CSharp8, 176LanguageVersion = LanguageVersion.CSharp9, 197LanguageVersion = LanguageVersion.CSharp8, 218LanguageVersion = LanguageVersion.CSharp9, 242LanguageVersion = LanguageVersion.CSharp9, 265LanguageVersion = LanguageVersion.CSharp8, 300LanguageVersion = LanguageVersion.CSharp9, 337LanguageVersion = LanguageVersion.CSharp10, 360LanguageVersion = LanguageVersion.CSharp8, 383LanguageVersion = LanguageVersion.CSharp8, 420LanguageVersion = LanguageVersion.CSharp10, 451LanguageVersion = LanguageVersion.CSharp9, 482LanguageVersion = LanguageVersion.CSharp9, 517LanguageVersion = LanguageVersion.CSharp9, 548LanguageVersion = LanguageVersion.CSharp9, 599LanguageVersion = LanguageVersion.CSharp9, 620LanguageVersion = LanguageVersion.CSharp9, 641LanguageVersion = LanguageVersion.CSharp9, 665LanguageVersion = LanguageVersion.CSharp9, 700LanguageVersion = LanguageVersion.CSharp9, 737LanguageVersion = LanguageVersion.CSharp10, 772LanguageVersion = LanguageVersion.CSharp9, 809LanguageVersion = LanguageVersion.CSharp10, 834LanguageVersion = LanguageVersion.CSharp9, 871LanguageVersion = LanguageVersion.CSharp10, 984LanguageVersion = LanguageVersion.CSharp9, 1037LanguageVersion = LanguageVersion.CSharp9, 1134LanguageVersion = LanguageVersion.CSharp9, 1155LanguageVersion = LanguageVersion.CSharp9, 1228LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (14)
42[InlineData("x == null", "o is not string x", LanguageVersion.CSharp9)] 43public async Task InlineTypeCheck1(string input, string output, LanguageVersion version = LanguageVersion.CSharp8) 59private async Task TestStatement(string input, string output, LanguageVersion version = LanguageVersion.CSharp8) 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\UsePatternMatching\CSharpUseNotPatternTests.cs (16)
49LanguageVersion = LanguageVersion.CSharp9, 80LanguageVersion = LanguageVersion.CSharp9, 111LanguageVersion = LanguageVersion.CSharp9, 142LanguageVersion = LanguageVersion.CSharp9, 173LanguageVersion = LanguageVersion.CSharp9, 204LanguageVersion = LanguageVersion.CSharp9, 247LanguageVersion = LanguageVersion.CSharp9, 284LanguageVersion = LanguageVersion.CSharp9, 304LanguageVersion = LanguageVersion.CSharp8, 335LanguageVersion = LanguageVersion.CSharp9, 366LanguageVersion = LanguageVersion.CSharp9, 401LanguageVersion = LanguageVersion.CSharp9, 421LanguageVersion = LanguageVersion.CSharp9, 444LanguageVersion = LanguageVersion.CSharp9, 467LanguageVersion = LanguageVersion.CSharp9, 506LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UsePrimaryConstructor\UsePrimaryConstructorTests.cs (140)
40LanguageVersion = LanguageVersion.CSharp12, 57LanguageVersion = LanguageVersion.CSharp11, 74LanguageVersion = LanguageVersion.CSharp12, 96LanguageVersion = LanguageVersion.CSharp12, 117LanguageVersion = LanguageVersion.CSharp12, 146LanguageVersion = LanguageVersion.CSharp12, 183LanguageVersion = LanguageVersion.CSharp12, 220LanguageVersion = LanguageVersion.CSharp12, 259LanguageVersion = LanguageVersion.CSharp12, 298LanguageVersion = LanguageVersion.CSharp12, 339LanguageVersion = LanguageVersion.CSharp12, 355LanguageVersion = LanguageVersion.CSharp12, 373LanguageVersion = LanguageVersion.CSharp12, 397LanguageVersion = LanguageVersion.CSharp12, 421LanguageVersion = LanguageVersion.CSharp12, 445LanguageVersion = LanguageVersion.CSharp12, 469LanguageVersion = LanguageVersion.CSharp12, 490LanguageVersion = LanguageVersion.CSharp12, 511LanguageVersion = LanguageVersion.CSharp12, 529LanguageVersion = LanguageVersion.CSharp12, 550LanguageVersion = LanguageVersion.CSharp12, 574LanguageVersion = LanguageVersion.CSharp12, 603LanguageVersion = LanguageVersion.CSharp12, 630LanguageVersion = LanguageVersion.CSharp12, 658LanguageVersion = LanguageVersion.CSharp12, 686LanguageVersion = LanguageVersion.CSharp12, 715LanguageVersion = LanguageVersion.CSharp12, 738LanguageVersion = LanguageVersion.CSharp12, 793LanguageVersion = LanguageVersion.CSharp12, 832LanguageVersion = LanguageVersion.CSharp12, 871LanguageVersion = LanguageVersion.CSharp12, 910LanguageVersion = LanguageVersion.CSharp12, 951LanguageVersion = LanguageVersion.CSharp12, 994LanguageVersion = LanguageVersion.CSharp12, 1037LanguageVersion = LanguageVersion.CSharp12, 1059LanguageVersion = LanguageVersion.CSharp12, 1081LanguageVersion = LanguageVersion.CSharp12, 1111LanguageVersion = LanguageVersion.CSharp12, 1147LanguageVersion = LanguageVersion.CSharp12, 1187LanguageVersion = LanguageVersion.CSharp12, 1217LanguageVersion = LanguageVersion.CSharp12, 1265LanguageVersion = LanguageVersion.CSharp12, 1309LanguageVersion = LanguageVersion.CSharp12, 1349LanguageVersion = LanguageVersion.CSharp12, 1398LanguageVersion = LanguageVersion.CSharp12, 1445LanguageVersion = LanguageVersion.CSharp12, 1487LanguageVersion = LanguageVersion.CSharp12, 1529LanguageVersion = LanguageVersion.CSharp12, 1577LanguageVersion = LanguageVersion.CSharp12, 1625LanguageVersion = LanguageVersion.CSharp12, 1672LanguageVersion = LanguageVersion.CSharp12, 1721LanguageVersion = LanguageVersion.CSharp12, 1754LanguageVersion = LanguageVersion.CSharp12, 1786LanguageVersion = LanguageVersion.CSharp12, 1827LanguageVersion = LanguageVersion.CSharp12, 1886LanguageVersion = LanguageVersion.CSharp12, 1914LanguageVersion = LanguageVersion.CSharp12, 1942LanguageVersion = LanguageVersion.CSharp12, 1976LanguageVersion = LanguageVersion.CSharp12, 2012LanguageVersion = LanguageVersion.CSharp12, 2049LanguageVersion = LanguageVersion.CSharp12, 2088LanguageVersion = LanguageVersion.CSharp12, 2120LanguageVersion = LanguageVersion.CSharp12, 2155LanguageVersion = LanguageVersion.CSharp12, 2183LanguageVersion = LanguageVersion.CSharp12, 2217LanguageVersion = LanguageVersion.CSharp12, 2247LanguageVersion = LanguageVersion.CSharp12, 2283LanguageVersion = LanguageVersion.CSharp12, 2311LanguageVersion = LanguageVersion.CSharp12, 2345LanguageVersion = LanguageVersion.CSharp12, 2375LanguageVersion = LanguageVersion.CSharp12, 2411LanguageVersion = LanguageVersion.CSharp12, 2440LanguageVersion = LanguageVersion.CSharp12, 2473LanguageVersion = LanguageVersion.CSharp12, 2502LanguageVersion = LanguageVersion.CSharp12, 2535LanguageVersion = LanguageVersion.CSharp12, 2565LanguageVersion = LanguageVersion.CSharp12, 2586LanguageVersion = LanguageVersion.CSharp12, 2612LanguageVersion = LanguageVersion.CSharp12, 2638LanguageVersion = LanguageVersion.CSharp12, 2660LanguageVersion = LanguageVersion.CSharp12, 2682LanguageVersion = LanguageVersion.CSharp12, 2706LanguageVersion = LanguageVersion.CSharp12, 2730LanguageVersion = LanguageVersion.CSharp12, 2754LanguageVersion = LanguageVersion.CSharp12, 2778LanguageVersion = LanguageVersion.CSharp12, 2804LanguageVersion = LanguageVersion.CSharp12, 2830LanguageVersion = LanguageVersion.CSharp12, 2863LanguageVersion = LanguageVersion.CSharp12, 2904LanguageVersion = LanguageVersion.CSharp12, 2936LanguageVersion = LanguageVersion.CSharp12, 2968LanguageVersion = LanguageVersion.CSharp12, 2996LanguageVersion = LanguageVersion.CSharp12, 3024LanguageVersion = LanguageVersion.CSharp12, 3052LanguageVersion = LanguageVersion.CSharp12, 3129LanguageVersion = LanguageVersion.CSharp12, 3167LanguageVersion = LanguageVersion.CSharp12, 3212LanguageVersion = LanguageVersion.CSharp12, 3250LanguageVersion = LanguageVersion.CSharp12, 3292LanguageVersion = LanguageVersion.CSharp12, 3321LanguageVersion = LanguageVersion.CSharp12, 3343LanguageVersion = LanguageVersion.CSharp12, 3370LanguageVersion = LanguageVersion.CSharp12, 3391LanguageVersion = LanguageVersion.CSharp12, 3420LanguageVersion = LanguageVersion.CSharp12, 3442LanguageVersion = LanguageVersion.CSharp12, 3468LanguageVersion = LanguageVersion.CSharp12, 3497LanguageVersion = LanguageVersion.CSharp12, 3526LanguageVersion = LanguageVersion.CSharp12, 3555LanguageVersion = LanguageVersion.CSharp12, 3584LanguageVersion = LanguageVersion.CSharp12, 3606LanguageVersion = LanguageVersion.CSharp12, 3628LanguageVersion = LanguageVersion.CSharp12, 3645LanguageVersion = LanguageVersion.CSharp12, 3692LanguageVersion = LanguageVersion.CSharp12, 3728LanguageVersion = LanguageVersion.CSharp12, 3765LanguageVersion = LanguageVersion.CSharp12, 3791LanguageVersion = LanguageVersion.CSharp12, 3813LanguageVersion = LanguageVersion.CSharp12, 3839LanguageVersion = LanguageVersion.CSharp12, 3869LanguageVersion = LanguageVersion.CSharp12, 3912LanguageVersion = LanguageVersion.CSharp12, 3955LanguageVersion = LanguageVersion.CSharp12, 3998LanguageVersion = LanguageVersion.CSharp12, 4027LanguageVersion = LanguageVersion.CSharp12, 4070LanguageVersion = LanguageVersion.CSharp12, 4100LanguageVersion = LanguageVersion.CSharp12, 4126LanguageVersion = LanguageVersion.CSharp12, 4159LanguageVersion = LanguageVersion.CSharp12, 4188LanguageVersion = LanguageVersion.CSharp12, 4220LanguageVersion = LanguageVersion.CSharp12, 4249LanguageVersion = LanguageVersion.CSharp12, 4280LanguageVersion = LanguageVersion.CSharp12, 4308LanguageVersion = LanguageVersion.CSharp12, 4341LanguageVersion = LanguageVersion.CSharp12, 4371LanguageVersion = LanguageVersion.CSharp12, 4405LanguageVersion = LanguageVersion.CSharp12, 4436LanguageVersion = LanguageVersion.CSharp12, 4468LanguageVersion = LanguageVersion.CSharp12, 4503LanguageVersion = LanguageVersion.CSharp12,
src\Analyzers\CSharp\Tests\UseSimpleUsingStatement\UseSimpleUsingStatementTests.cs (7)
142LanguageVersion = LanguageVersion.CSharp7_2 1944LanguageVersion = LanguageVersion.CSharp9, 1979LanguageVersion = LanguageVersion.CSharp9, 2005LanguageVersion = LanguageVersion.CSharp9, 2044LanguageVersion = LanguageVersion.CSharp9, 2079LanguageVersion = LanguageVersion.CSharp9, 2116LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseSystemThreadingLock\UseSystemThreadingLockTests.cs (45)
64LanguageVersion = LanguageVersion.CSharp13, 87LanguageVersion = LanguageVersion.CSharp12, 110LanguageVersion = LanguageVersion.CSharp12, 133LanguageVersion = LanguageVersion.CSharp12, 171LanguageVersion = LanguageVersion.CSharp13, 209LanguageVersion = LanguageVersion.CSharp13, 232LanguageVersion = LanguageVersion.CSharp13, 255LanguageVersion = LanguageVersion.CSharp13, 280LanguageVersion = LanguageVersion.CSharp13, 303LanguageVersion = LanguageVersion.CSharp13, 343LanguageVersion = LanguageVersion.CSharp13, 381LanguageVersion = LanguageVersion.CSharp13, 422LanguageVersion = LanguageVersion.CSharp13, 460LanguageVersion = LanguageVersion.CSharp13, 486LanguageVersion = LanguageVersion.CSharp13, 531LanguageVersion = LanguageVersion.CSharp13, 584LanguageVersion = LanguageVersion.CSharp13, 604LanguageVersion = LanguageVersion.CSharp13, 631LanguageVersion = LanguageVersion.CSharp13, 656LanguageVersion = LanguageVersion.CSharp13, 679LanguageVersion = LanguageVersion.CSharp13, 702LanguageVersion = LanguageVersion.CSharp13, 725LanguageVersion = LanguageVersion.CSharp13, 753LanguageVersion = LanguageVersion.CSharp13, 781LanguageVersion = LanguageVersion.CSharp13, 804LanguageVersion = LanguageVersion.CSharp13, 827LanguageVersion = LanguageVersion.CSharp13, 873LanguageVersion = LanguageVersion.CSharp13, 921LanguageVersion = LanguageVersion.CSharp13, 959LanguageVersion = LanguageVersion.CSharp13, 997LanguageVersion = LanguageVersion.CSharp13, 1035LanguageVersion = LanguageVersion.CSharp13, 1073LanguageVersion = LanguageVersion.CSharp13, 1121LanguageVersion = LanguageVersion.CSharp13, 1169LanguageVersion = LanguageVersion.CSharp13, 1217LanguageVersion = LanguageVersion.CSharp13, 1265LanguageVersion = LanguageVersion.CSharp13, 1321LanguageVersion = LanguageVersion.CSharp13, 1377LanguageVersion = LanguageVersion.CSharp13, 1417LanguageVersion = LanguageVersion.CSharp13, 1438LanguageVersion = LanguageVersion.CSharp13, 1478LanguageVersion = LanguageVersion.CSharp13, 1524LanguageVersion = LanguageVersion.CSharp13, 1568LanguageVersion = LanguageVersion.CSharp13, 1612LanguageVersion = LanguageVersion.CSharp13,
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));
src\Analyzers\CSharp\Tests\UseTupleSwap\UseTupleSwapTests.cs (2)
42LanguageVersion = LanguageVersion.CSharp6, 444LanguageVersion = LanguageVersion.CSharp9,
src\Analyzers\CSharp\Tests\UseUnboundGenericTypeInNameOf\UseUnboundGenericTypeInNameOfTests.cs (1)
90LanguageVersion = LanguageVersion.CSharp13,
src\Analyzers\CSharp\Tests\UseUtf8StringLiteral\UseUtf8StringLiteralTests.cs (49)
47LanguageVersion = LanguageVersion.CSharp12 66LanguageVersion = LanguageVersion.CSharp10 86LanguageVersion = LanguageVersion.CSharp12 106LanguageVersion = LanguageVersion.CSharp12 133LanguageVersion = LanguageVersion.CSharp12 153LanguageVersion = LanguageVersion.CSharp12 177LanguageVersion = LanguageVersion.CSharp12 199LanguageVersion = LanguageVersion.CSharp12 219LanguageVersion = LanguageVersion.CSharp12 250LanguageVersion = LanguageVersion.CSharp12 283LanguageVersion = LanguageVersion.CSharp12 314LanguageVersion = LanguageVersion.CSharp12 345LanguageVersion = LanguageVersion.CSharp12 376LanguageVersion = LanguageVersion.CSharp12 407LanguageVersion = LanguageVersion.CSharp12 437LanguageVersion = LanguageVersion.CSharp12 468LanguageVersion = LanguageVersion.CSharp12 499LanguageVersion = LanguageVersion.CSharp12 534LanguageVersion = LanguageVersion.CSharp12 565LanguageVersion = LanguageVersion.CSharp12 596LanguageVersion = LanguageVersion.CSharp12 617LanguageVersion = LanguageVersion.CSharp12 638LanguageVersion = LanguageVersion.CSharp12 659LanguageVersion = LanguageVersion.CSharp12 693LanguageVersion = LanguageVersion.CSharp12 774LanguageVersion = LanguageVersion.CSharp12 802LanguageVersion = LanguageVersion.CSharp12 835LanguageVersion = LanguageVersion.CSharp12 890LanguageVersion = LanguageVersion.CSharp12 921LanguageVersion = LanguageVersion.CSharp12 952LanguageVersion = LanguageVersion.CSharp12 983LanguageVersion = LanguageVersion.CSharp12 1014LanguageVersion = LanguageVersion.CSharp12 1045LanguageVersion = LanguageVersion.CSharp12 1076LanguageVersion = LanguageVersion.CSharp12 1096LanguageVersion = LanguageVersion.CSharp12 1127LanguageVersion = LanguageVersion.CSharp12 1158LanguageVersion = LanguageVersion.CSharp12 1189LanguageVersion = LanguageVersion.CSharp12 1220LanguageVersion = LanguageVersion.CSharp12 1251LanguageVersion = LanguageVersion.CSharp12 1292LanguageVersion = LanguageVersion.CSharp12 1347LanguageVersion = LanguageVersion.CSharp12 1436LanguageVersion = LanguageVersion.CSharp12 1467LanguageVersion = LanguageVersion.CSharp12 1498LanguageVersion = LanguageVersion.CSharp12 1529LanguageVersion = LanguageVersion.CSharp12 1564LanguageVersion = LanguageVersion.CSharp12 1599LanguageVersion = LanguageVersion.CSharp12
UseExpressionBody\Refactoring\UseExpressionBodyForPropertiesRefactoringTests.cs (1)
308}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6),
UseNamedArguments\UseNamedArgumentsTests.cs (4)
33LanguageVersion = LanguageVersion.CSharp7, 44LanguageVersion = LanguageVersion.CSharp7_2, 54LanguageVersion = LanguageVersion.CSharp7_3, 102LanguageVersion = LanguageVersion.CSharp7_2,
UseNameofInAttribute\UseNameofInAttributeTests.cs (14)
44LanguageVersion = LanguageVersion.CSharp11, 72LanguageVersion = LanguageVersion.CSharp11, 100LanguageVersion = LanguageVersion.CSharp11, 128LanguageVersion = LanguageVersion.CSharp11, 156LanguageVersion = LanguageVersion.CSharp11, 177LanguageVersion = LanguageVersion.CSharp10, 198LanguageVersion = LanguageVersion.CSharp11, 219LanguageVersion = LanguageVersion.CSharp11, 240LanguageVersion = LanguageVersion.CSharp11, 266LanguageVersion = LanguageVersion.CSharp11, 312LanguageVersion = LanguageVersion.CSharp11, 362LanguageVersion = LanguageVersion.CSharp11, 388LanguageVersion = LanguageVersion.CSharp11, 414LanguageVersion = LanguageVersion.CSharp11,
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)));
UseRecursivePatterns\UseRecursivePatternsRefactoringTests.cs (12)
25LanguageVersion languageVersion = LanguageVersion.CSharp9) 80[InlineData("a.b.c.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 81[InlineData("a?.b.c.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 82[InlineData("a.b?.c.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 83[InlineData("a.b.c?.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 84[InlineData("a.b?.c?.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 85[InlineData("a?.b.c?.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 86[InlineData("a?.b?.c.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 87[InlineData("a?.b?.c?.d && b", "this is { a.b.c.d: n, b: n }", LanguageVersion.CSharp10)] 98public async Task TestLogicalAndExpression_Receiver(string actual, string expected, LanguageVersion languageVersion = LanguageVersion.CSharp9)
Microsoft.CodeAnalysis.CSharp.Scripting (3)
CSharpScriptCompiler.cs (1)
18internal static readonly CSharpParseOptions DefaultParseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest);
ScriptOptionsExtensions.cs (2)
14public static ScriptOptions WithLanguageVersion(this ScriptOptions options, LanguageVersion languageVersion) 18: (options.ParseOptions is CSharpParseOptions existing) ? existing : throw new InvalidOperationException(string.Format(ScriptingResources.CannotSetLanguageSpecificOption, LanguageNames.CSharp, nameof(LanguageVersion)));
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (11)
CommandLineRunnerTests.cs (2)
769var expected = Enum.GetValues(typeof(LanguageVersion)).Cast<LanguageVersion>()
ScriptOptionsTests.cs (5)
22var options = ScriptOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 23Assert.Equal(LanguageVersion.CSharp8, ((CSharpParseOptions)options.ParseOptions).LanguageVersion); 29var options = ScriptOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 30Assert.Same(options, options.WithLanguageVersion(LanguageVersion.CSharp8)); 37Assert.Throws<InvalidOperationException>(() => options.WithLanguageVersion(LanguageVersion.CSharp8));
ScriptTests.cs (4)
475var state0 = await CSharpScript.RunAsync("static int Add(int x, int y) => x + y;", options: ScriptOptions.WithLanguageVersion(LanguageVersion.Preview)); 955var script = CSharpScript.Create(@"string x = default;", ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp7)); 969string x = null;", ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp8)); 991var script = CSharpScript.Create(code, ScriptOptions.WithLanguageVersion(LanguageVersion.CSharp8));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (742)
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 (32)
6485foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6524foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6569foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6614foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6659foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6704foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6743foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 }) 6782foreach (var languageVersion in new[] { CSharp.LanguageVersion.Preview, CSharp.LanguageVersion.CSharp13, CSharp.LanguageVersion.CSharp12 })
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\GenericConstraintsTests.cs (4)
351var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 908var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 1390var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 2086var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2);
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 (16)
1155languageVersion: LanguageVersion.CSharp10, 1366languageVersion: LanguageVersion.CSharp10, 14911[InlineData(LanguageVersion.CSharp10)] 14912[InlineData(LanguageVersion.CSharp11)] 14913public void RefEscape_08(LanguageVersion languageVersion) 15051[InlineData(LanguageVersion.CSharp10)] 15052[InlineData(LanguageVersion.CSharp11)] 15053public void RefEscape_11A(LanguageVersion languageVersion) 15128[InlineData(LanguageVersion.CSharp10)] 15129[InlineData(LanguageVersion.CSharp11)] 15130public void RefEscape_12A(LanguageVersion languageVersion) 15218[InlineData(LanguageVersion.CSharp10)] 15219[InlineData(LanguageVersion.CSharp11)] 15220public void RefEscape_13A(LanguageVersion languageVersion) 18255CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 18274CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\LambdaTests.cs (6)
7143[InlineData(LanguageVersion.CSharp11)] 7144[InlineData(LanguageVersion.CSharp12)] 7145public void AnonymousMethodWithExplicitDefaultParam(LanguageVersion languageVersion) 8262[InlineData(LanguageVersion.CSharp11)] 8263[InlineData(LanguageVersion.CSharp12)] 8264public void ParamsArray_Langversion_DelegateSyntax(LanguageVersion languageVersion)
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 (11)
1221[InlineData(LanguageVersion.CSharp10)] 1222[InlineData(LanguageVersion.CSharp11)] 1223public void SuppressNullableWarning_RefReturn(LanguageVersion langVersion) 1258[InlineData(LanguageVersion.CSharp10)] 1259[InlineData(LanguageVersion.CSharp11)] 1260public void SuppressNullableWarning_RefSpanReturn(LanguageVersion languageVersion) 81300parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp8)); 81371var comp = CreateCompilationWithMscorlib40AndSystemCore(new[] { source }, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp8)); 155367[CombinatorialValues(LanguageVersion.CSharp9, LanguageVersion.CSharp11)] LanguageVersion 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 (3)
7952[InlineData(LanguageVersion.CSharp10)] 7953[InlineData(LanguageVersion.CSharp11)] 7954public void WithExprOnStruct_OnRefStruct_ReceiverMayWrap(LanguageVersion languageVersion)
Semantics\RefEscapingTests.cs (291)
124[InlineData(LanguageVersion.CSharp10)] 125[InlineData(LanguageVersion.CSharp11)] 126public void RefStructInFor(LanguageVersion languageVersion) 170[InlineData(LanguageVersion.CSharp10)] 171[InlineData(LanguageVersion.CSharp11)] 172public void RefStructEscapeInIterator(LanguageVersion languageVersion) 201[InlineData(LanguageVersion.CSharp10)] 202[InlineData(LanguageVersion.CSharp11)] 203public void RefLikeReturnEscape(LanguageVersion languageVersion) 250[InlineData(LanguageVersion.CSharp10)] 251[InlineData(LanguageVersion.CSharp11)] 252public void RefLikeReturnEscape1(LanguageVersion languageVersion) 531[InlineData(LanguageVersion.CSharp10)] 532[InlineData(LanguageVersion.CSharp11)] 533public void RefLikeScopeEscape(LanguageVersion languageVersion) 577[InlineData(LanguageVersion.CSharp10)] 578[InlineData(LanguageVersion.CSharp11)] 579public void RefLikeScopeEscapeVararg(LanguageVersion languageVersion) 623[InlineData(LanguageVersion.CSharp10)] 624[InlineData(LanguageVersion.CSharp11)] 625public void RefScopeEscapeVararg(LanguageVersion languageVersion) 684[InlineData(LanguageVersion.CSharp10)] 685[InlineData(LanguageVersion.CSharp11)] 686public void ThrowExpression(LanguageVersion languageVersion) 715[InlineData(LanguageVersion.CSharp10)] 716[InlineData(LanguageVersion.CSharp11)] 717public void UserDefinedLogical(LanguageVersion languageVersion) 815[InlineData(LanguageVersion.CSharp10)] 816[InlineData(LanguageVersion.CSharp11)] 817public void DiscardExpressionRef_UnsafeContext(LanguageVersion languageVersion) 836if (languageVersion == LanguageVersion.CSharp10) 972[InlineData(LanguageVersion.CSharp10)] 973[InlineData(LanguageVersion.CSharp11)] 974public void DiscardExpressionSpan_UnsafeContext(LanguageVersion languageVersion) 1006if (languageVersion == LanguageVersion.CSharp10) 1088[InlineData(LanguageVersion.CSharp10)] 1089[InlineData(LanguageVersion.CSharp11)] 1090public void DiscardExpressionSpan_02(LanguageVersion languageVersion) 1143[InlineData(LanguageVersion.CSharp10)] 1144[InlineData(LanguageVersion.CSharp11)] 1145public void DiscardExpressionSpan_03(LanguageVersion languageVersion) 1195[InlineData(LanguageVersion.CSharp10)] 1196[InlineData(LanguageVersion.CSharp11)] 1197public void DiscardExpressionSpan_04(LanguageVersion languageVersion) 1247[InlineData(LanguageVersion.CSharp10)] 1248[InlineData(LanguageVersion.CSharp11)] 1249public void DiscardExpressionSpan_05(LanguageVersion languageVersion) 1316[InlineData(LanguageVersion.CSharp10)] 1317[InlineData(LanguageVersion.CSharp11)] 1318public void DiscardExpressionSpan_06(LanguageVersion languageVersion) 1429[InlineData(LanguageVersion.CSharp10)] 1430[InlineData(LanguageVersion.CSharp11)] 1431public void Discard_01(LanguageVersion languageVersion) 1458[InlineData(LanguageVersion.CSharp10)] 1459[InlineData(LanguageVersion.CSharp11)] 1460public void Discard_02(LanguageVersion languageVersion) 1499[InlineData(LanguageVersion.CSharp10)] 1500[InlineData(LanguageVersion.CSharp11)] 1501public void Discard_03(LanguageVersion languageVersion) 1530[InlineData(LanguageVersion.CSharp10)] 1531[InlineData(LanguageVersion.CSharp11)] 1532public void Discard_04(LanguageVersion languageVersion) 1593[InlineData(LanguageVersion.CSharp10)] 1594[InlineData(LanguageVersion.CSharp11)] 1595public void Discard_05(LanguageVersion languageVersion) 1822[InlineData(LanguageVersion.CSharp10)] 1823[InlineData(LanguageVersion.CSharp11)] 1824public void RefLikeScopeEscapeThis(LanguageVersion languageVersion) 1875[InlineData(LanguageVersion.CSharp10)] 1876[InlineData(LanguageVersion.CSharp11)] 1877public void RefLikeScopeEscapeThisRef(LanguageVersion languageVersion) 1950[InlineData(LanguageVersion.CSharp10)] 1951[InlineData(LanguageVersion.CSharp11)] 1952public void RefLikeScopeEscapeField(LanguageVersion languageVersion) 2003[InlineData(LanguageVersion.CSharp10)] 2004[InlineData(LanguageVersion.CSharp11)] 2005public void RefLikeEscapeParamsAndTopLevel(LanguageVersion languageVersion) 2044[InlineData(LanguageVersion.CSharp10)] 2045[InlineData(LanguageVersion.CSharp11)] 2046public void RefLikeEscapeMixingCallSameArgValue(LanguageVersion languageVersion) 2340[InlineData(LanguageVersion.CSharp10)] 2341[InlineData(LanguageVersion.CSharp11)] 2342public void RefLikeEscapeMixingIndex(LanguageVersion languageVersion) 2671[InlineData(LanguageVersion.CSharp10)] 2672[InlineData(LanguageVersion.CSharp11)] 2674public void RefLikeEscapeMixingIndexer1(LanguageVersion languageVersion) 2916""", options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 2923[InlineData(LanguageVersion.CSharp10)] 2924[InlineData(LanguageVersion.CSharp11)] 2926public void RefLikeEscapeMixingIndexer3(LanguageVersion languageVersion) 3039""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3173[InlineData(LanguageVersion.CSharp10)] 3174[InlineData(LanguageVersion.CSharp11)] 3176public void RefLikeEscapeMixingObjectInitializer1(LanguageVersion languageVersion) 3276""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3363""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp13)); 3446""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3456[InlineData(LanguageVersion.CSharp10)] 3457[InlineData(LanguageVersion.CSharp11)] 3458public void RefLikeObjInitializers(LanguageVersion languageVersion) 3521[InlineData(LanguageVersion.CSharp10)] 3522[InlineData(LanguageVersion.CSharp11)] 3523public void RefLikeObjInitializers1(LanguageVersion languageVersion) 3590[InlineData(LanguageVersion.CSharp10)] 3591[InlineData(LanguageVersion.CSharp11)] 3592public void RefLikeObjInitializersIndexer(LanguageVersion languageVersion) 3664[InlineData(LanguageVersion.CSharp10)] 3665[InlineData(LanguageVersion.CSharp11)] 3666public void ObjectInitializer_Indexer_RefLikeType_Mixed(LanguageVersion languageVersion) 3747[InlineData(LanguageVersion.CSharp10)] 3748[InlineData(LanguageVersion.CSharp11)] 3750public void ObjectInitializer_Arguments_Escape(LanguageVersion languageVersion) 3827""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 3992""", TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 4130[InlineData(LanguageVersion.CSharp10)] 4131[InlineData(LanguageVersion.CSharp11)] 4133public void ObjectInitializer_Property_RefLikeType(LanguageVersion languageVersion) 4260[InlineData(LanguageVersion.CSharp10)] 4261[InlineData(LanguageVersion.CSharp11)] 4262public void RefLikeObjInitializersNested(LanguageVersion languageVersion) 4355[InlineData(LanguageVersion.CSharp10)] 4356[InlineData(LanguageVersion.CSharp11)] 4357public void RefLikeColInitializer(LanguageVersion languageVersion) 4519[InlineData(LanguageVersion.CSharp10)] 4520[InlineData(LanguageVersion.CSharp11)] 4521public void MismatchedRefTernaryEscape(LanguageVersion languageVersion) 4565[InlineData(LanguageVersion.CSharp10)] 4566[InlineData(LanguageVersion.CSharp11)] 4567public void MismatchedRefTernaryEscapeBlock(LanguageVersion languageVersion) 4658[InlineData(LanguageVersion.CSharp10)] 4659[InlineData(LanguageVersion.CSharp11)] 4660public void MismatchedRefTernaryEscapeBlock_UnsafeContext(LanguageVersion languageVersion) 4751[InlineData(LanguageVersion.CSharp10)] 4752[InlineData(LanguageVersion.CSharp11)] 4753public void StackallocEscape(LanguageVersion languageVersion) 4805[InlineData(LanguageVersion.CSharp10)] 4806[InlineData(LanguageVersion.CSharp11)] 4807public void LocalWithNoInitializerEscape(LanguageVersion languageVersion) 4860[InlineData(LanguageVersion.CSharp10)] 4861[InlineData(LanguageVersion.CSharp11)] 4862public void FieldOfRefLikeEscape(LanguageVersion languageVersion) 4911[InlineData(LanguageVersion.CSharp10)] 4912[InlineData(LanguageVersion.CSharp11)] 4913public void MemberOfReadonlyRefLikeEscape(LanguageVersion languageVersion) 4958if (languageVersion == LanguageVersion.CSharp10) 4988[InlineData(LanguageVersion.CSharp10)] 4989[InlineData(LanguageVersion.CSharp11)] 4990public void MemberOfReadonlyRefLikeEscapeSpans(LanguageVersion languageVersion) 5034[InlineData(LanguageVersion.CSharp10)] 5035[InlineData(LanguageVersion.CSharp11)] 5036public void ReadOnlyRefStruct_Method_RefLikeStructParameter(LanguageVersion languageVersion) 5058[InlineData(LanguageVersion.CSharp10)] 5059[InlineData(LanguageVersion.CSharp11)] 5060public void ReadOnlyMethod_RefLikeStructParameter(LanguageVersion languageVersion) 5082[InlineData(LanguageVersion.CSharp10)] 5083[InlineData(LanguageVersion.CSharp11)] 5084public void ReadOnlyRefStruct_RefLikeProperty(LanguageVersion languageVersion) 5132[InlineData(LanguageVersion.CSharp10)] 5133[InlineData(LanguageVersion.CSharp11)] 5134public void ReadOnlyRefLikeProperty_01(LanguageVersion languageVersion) 5182[InlineData(LanguageVersion.CSharp10)] 5183[InlineData(LanguageVersion.CSharp11)] 5184public void ReadOnlyRefLikeProperty_02(LanguageVersion languageVersion) 5232[InlineData(LanguageVersion.CSharp10)] 5233[InlineData(LanguageVersion.CSharp11)] 5234public void ReadOnlyIndexer_RefLikeStructParameter_01(LanguageVersion languageVersion) 5261[InlineData(LanguageVersion.CSharp10)] 5262[InlineData(LanguageVersion.CSharp11)] 5263public void ReadOnlyIndexer_RefLikeStructParameter_02(LanguageVersion languageVersion) 5316[InlineData(LanguageVersion.CSharp10)] 5317[InlineData(LanguageVersion.CSharp11)] 5318public void RefTernaryMustMatchValEscapes(LanguageVersion languageVersion) 5364[InlineData(LanguageVersion.CSharp10)] 5365[InlineData(LanguageVersion.CSharp11)] 5366public void RefTernaryMustMatchValEscapes1(LanguageVersion languageVersion) 5403[InlineData(LanguageVersion.CSharp10)] 5404[InlineData(LanguageVersion.CSharp11)] 5405public void DeconstructionAssignmentToGlobal(LanguageVersion languageVersion) 5457[InlineData(LanguageVersion.CSharp10)] 5458[InlineData(LanguageVersion.CSharp11)] 5459public void DeconstructionAssignmentToRefMethods(LanguageVersion languageVersion) 5489[InlineData(LanguageVersion.CSharp10)] 5490[InlineData(LanguageVersion.CSharp11)] 5491public void DeconstructionAssignmentWithRefExtension(LanguageVersion languageVersion) 5517[InlineData(LanguageVersion.CSharp10)] 5518[InlineData(LanguageVersion.CSharp11)] 5519public void DeconstructionAssignmentWithRefExtension_UnsafeContext(LanguageVersion languageVersion) 5545[InlineData(LanguageVersion.CSharp10)] 5546[InlineData(LanguageVersion.CSharp11)] 5547public void DeconstructionAssignmentWithRefReadonlyExtension(LanguageVersion languageVersion) 5568if (languageVersion == LanguageVersion.CSharp10) 5597[InlineData(LanguageVersion.CSharp10)] 5598[InlineData(LanguageVersion.CSharp11)] 5599public void DeconstructionAssignmentWithRefReadonlyExtension_02(LanguageVersion languageVersion) 5632[InlineData(LanguageVersion.CSharp10)] 5633[InlineData(LanguageVersion.CSharp11)] 5634public void DeconstructionAssignmentWithRefReadonlyExtension_03(LanguageVersion languageVersion) 5667[InlineData(LanguageVersion.CSharp10)] 5668[InlineData(LanguageVersion.CSharp11)] 5669public void DeconstructionAssignmentWithReturnValue(LanguageVersion languageVersion) 5711[InlineData(LanguageVersion.CSharp10)] 5712[InlineData(LanguageVersion.CSharp11)] 5713public void DeconstructionAssignmentOfTuple(LanguageVersion languageVersion) 5810[InlineData(LanguageVersion.CSharp10)] 5811[InlineData(LanguageVersion.CSharp11)] 5812public void DeconstructionAssignmentOfTuple_WithoutValueTuple(LanguageVersion languageVersion) 5910[InlineData(LanguageVersion.CSharp10)] 5911[InlineData(LanguageVersion.CSharp11)] 5912public void DeconstructionAssignmentOfRefLikeTuple(LanguageVersion languageVersion) 5982[InlineData(LanguageVersion.CSharp10)] 5983[InlineData(LanguageVersion.CSharp11)] 5984public void DeconstructionAssignmentToOuter(LanguageVersion languageVersion) 6015[InlineData(LanguageVersion.CSharp10)] 6016[InlineData(LanguageVersion.CSharp11)] 6017public void DeconstructionDeclaration(LanguageVersion languageVersion) 6506[InlineData(LanguageVersion.CSharp10)] 6507[InlineData(LanguageVersion.CSharp11)] 6508public void RefLikeForeach(LanguageVersion languageVersion) 6542[InlineData(LanguageVersion.CSharp10)] 6543[InlineData(LanguageVersion.CSharp11)] 6544public void RefLikeDeconstructionForeach(LanguageVersion languageVersion) 6585[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 6621[InlineData(LanguageVersion.CSharp10)] 6622[InlineData(LanguageVersion.CSharp11)] 6623public void RefLikeOutVarFromLocal(LanguageVersion languageVersion) 6653[InlineData(LanguageVersion.CSharp10)] 6654[InlineData(LanguageVersion.CSharp11)] 6655public void RefLikeOutVarFromGlobal(LanguageVersion languageVersion) 6681[InlineData(LanguageVersion.CSharp10)] 6682[InlineData(LanguageVersion.CSharp11)] 6683public void InMatchesIn(LanguageVersion languageVersion) 6724[InlineData(LanguageVersion.CSharp10)] 6725[InlineData(LanguageVersion.CSharp11)] 6726public void PointerElementAccess_RefStructPointer(LanguageVersion languageVersion) 6753[InlineData(LanguageVersion.CSharp10)] 6754[InlineData(LanguageVersion.CSharp11)] 6755public void PointerIndirectionOperator_RefStructPointer(LanguageVersion languageVersion) 6778[InlineData(LanguageVersion.CSharp10)] 6779[InlineData(LanguageVersion.CSharp11)] 6780public void PropertyEscape(LanguageVersion languageVersion) 6878[InlineData(LanguageVersion.CSharp10)] 6879[InlineData(LanguageVersion.CSharp11)] 6880[InlineData(LanguageVersion.CSharp13)] 6881public void AwaitRefStruct(LanguageVersion languageVersion) 6904if (languageVersion == LanguageVersion.CSharp10) 6921else if (languageVersion == LanguageVersion.CSharp11) 6985[InlineData(LanguageVersion.CSharp10)] 6986[InlineData(LanguageVersion.CSharp11)] 6987public void CoalesceRefStruct(LanguageVersion languageVersion) 7012[InlineData(LanguageVersion.CSharp10)] 7013[InlineData(LanguageVersion.CSharp11)] 7014public void ArrayAccessRefStruct(LanguageVersion languageVersion) 7039[InlineData(LanguageVersion.CSharp10)] 7040[InlineData(LanguageVersion.CSharp11)] 7041public void ConditionalRefStruct(LanguageVersion languageVersion) 7068[InlineData(LanguageVersion.CSharp10)] 7069[InlineData(LanguageVersion.CSharp11)] 7070public void ArrayAccess_CrashesEscapeRules(LanguageVersion languageVersion) 7092[InlineData(LanguageVersion.CSharp10)] 7093[InlineData(LanguageVersion.CSharp11)] 7094public void RefThisAssignment_Class(LanguageVersion languageVersion) 7122[InlineData(LanguageVersion.CSharp10)] 7123[InlineData(LanguageVersion.CSharp11)] 7124public void RefThisAssignment_Struct(LanguageVersion languageVersion) 7149[InlineData(LanguageVersion.CSharp10)] 7150[InlineData(LanguageVersion.CSharp11)] 7151public void RefThisAssignment_ReadOnlyStruct(LanguageVersion languageVersion) 7176[InlineData(LanguageVersion.CSharp10)] 7177[InlineData(LanguageVersion.CSharp11)] 7178public void RefThisAssignment_RefStruct(LanguageVersion languageVersion) 7205[InlineData(LanguageVersion.CSharp10)] 7206[InlineData(LanguageVersion.CSharp11)] 7207public void RefThisAssignment_ReadOnlyRefStruct(LanguageVersion languageVersion) 7232[InlineData(LanguageVersion.CSharp10)] 7233[InlineData(LanguageVersion.CSharp11)] 7234public void CoalesceSpanReturn(LanguageVersion languageVersion) 7249[InlineData(LanguageVersion.CSharp10)] 7250[InlineData(LanguageVersion.CSharp11)] 7251public void CoalesceAssignSpanReturn(LanguageVersion languageVersion) 7267[InlineData(LanguageVersion.CSharp10)] 7268[InlineData(LanguageVersion.CSharp11)] 7269public void CoalesceRefSpanReturn(LanguageVersion languageVersion) 7327[InlineData(LanguageVersion.CSharp10)] 7328[InlineData(LanguageVersion.CSharp11)] 7329public void ConvertedSpanReturn(LanguageVersion languageVersion) 10249[InlineData(LanguageVersion.CSharp10)] 10250[InlineData(LanguageVersion.CSharp11)] 10252public void UserDefinedBinaryOperator_RefStruct_Compound_RegressionTest1(LanguageVersion 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 (272)
2275[InlineData(LanguageVersion.CSharp10)] 2276[InlineData(LanguageVersion.CSharp11)] 2277[InlineData(LanguageVersion.Latest)] 2278public void RequiredField_01(LanguageVersion languageVersion) 2290if (languageVersion == LanguageVersion.CSharp10) 4916[InlineData(LanguageVersion.CSharp10)] 4917[InlineData(LanguageVersion.CSharp11)] 4918public void Arglist_RefToRefStruct(LanguageVersion languageVersion) 4942[InlineData(LanguageVersion.CSharp10)] 4943[InlineData(LanguageVersion.CSharp11)] 4944public void Arglist_RefReturnedAsRef(LanguageVersion languageVersion) 5045[InlineData(LanguageVersion.CSharp10)] 5046[InlineData(LanguageVersion.CSharp11)] 5047public void ImplicitIn_02(LanguageVersion languageVersion) 9109[InlineData(LanguageVersion.CSharp10)] 9110[InlineData(LanguageVersion.CSharp11)] 9111public void Deconstruct_01(LanguageVersion languageVersion) 9149[InlineData(LanguageVersion.CSharp10)] 9150[InlineData(LanguageVersion.CSharp11)] 9151public void Deconstruct_02A(LanguageVersion languageVersion) 9172[InlineData(LanguageVersion.CSharp10)] 9173[InlineData(LanguageVersion.CSharp11)] 9174public void Deconstruct_02B(LanguageVersion languageVersion) 9195[InlineData(LanguageVersion.CSharp10)] 9196[InlineData(LanguageVersion.CSharp11)] 9197public void Deconstruct_03A(LanguageVersion languageVersion) 9239[InlineData(LanguageVersion.CSharp10)] 9240[InlineData(LanguageVersion.CSharp11)] 9241public void Deconstruct_03B(LanguageVersion languageVersion) 9282[InlineData(LanguageVersion.CSharp10)] 9283[InlineData(LanguageVersion.CSharp11)] 9284public void Deconstruct_04(LanguageVersion languageVersion) 9328[InlineData(LanguageVersion.CSharp10)] 9329[InlineData(LanguageVersion.CSharp11)] 9330public void Deconstruct_05(LanguageVersion languageVersion) 9350[InlineData(LanguageVersion.CSharp10)] 9351[InlineData(LanguageVersion.CSharp11)] 9352public void Deconstruct_06(LanguageVersion languageVersion) 9400[InlineData(LanguageVersion.CSharp10)] 9401[InlineData(LanguageVersion.CSharp11)] 9402public void Deconstruct_08(LanguageVersion languageVersion) 9427[InlineData(LanguageVersion.CSharp10)] 9428[InlineData(LanguageVersion.CSharp11)] 9429public void Deconstruct_09(LanguageVersion languageVersion) 9470if (languageVersion == LanguageVersion.CSharp10) 9487[InlineData(LanguageVersion.CSharp10)] 9488[InlineData(LanguageVersion.CSharp11)] 9489public void Deconstruct_10(LanguageVersion languageVersion) 9532[InlineData(LanguageVersion.CSharp10)] 9533[InlineData(LanguageVersion.CSharp11)] 9534public void Deconstruct_11(LanguageVersion languageVersion) 9577[InlineData(LanguageVersion.CSharp10)] 9578[InlineData(LanguageVersion.CSharp11)] 9579public void Deconstruct_12(LanguageVersion languageVersion) 9641[InlineData(LanguageVersion.CSharp10)] 9642[InlineData(LanguageVersion.CSharp11)] 9643public void Deconstruct_13(LanguageVersion languageVersion) 9723[InlineData(LanguageVersion.CSharp10)] 9724[InlineData(LanguageVersion.CSharp11)] 9725public void ReturnRefToByValueParameter_01(LanguageVersion languageVersion) 9747if (languageVersion == LanguageVersion.CSharp10) 9773[InlineData(LanguageVersion.CSharp10)] 9774[InlineData(LanguageVersion.CSharp11)] 9775public void ReturnRefToByValueParameter_02(LanguageVersion languageVersion) 10115[InlineData(LanguageVersion.CSharp10)] 10116[InlineData(LanguageVersion.CSharp11)] 10117public void Span_01(LanguageVersion languageVersion) 10143[InlineData(LanguageVersion.CSharp10)] 10144[InlineData(LanguageVersion.CSharp11)] 10145public void Span_02(LanguageVersion languageVersion) 10297[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 10341[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 10391[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 10419if (languageVersion == LanguageVersion.CSharp10) 10441[InlineData(LanguageVersion.CSharp10)] 10442[InlineData(LanguageVersion.CSharp11)] 10443public void RefAssignValueScopeMismatch_03(LanguageVersion languageVersion) 10471if (languageVersion == LanguageVersion.CSharp10) 10610[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10611[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 10640[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10641[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 10673[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10674[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 10702if (languageVersionA == LanguageVersion.CSharp10) 10730[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10731[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 10761if (languageVersionA == LanguageVersion.CSharp10) 10788[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10789[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 10813if (languageVersionA == LanguageVersion.CSharp10) 10831[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 10832[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 11512[InlineData(LanguageVersion.CSharp10)] 11513[InlineData(LanguageVersion.CSharp11)] 11514public void ThisScope(LanguageVersion languageVersion) 11568bool useUpdatedEscapeRules = languageVersion == LanguageVersion.CSharp11; 11627[InlineData(LanguageVersion.CSharp10)] 11628[InlineData(LanguageVersion.CSharp11)] 11629public void ReturnTypeScope(LanguageVersion langVersion) 11661[InlineData(LanguageVersion.CSharp10)] 11662[InlineData(LanguageVersion.CSharp11)] 11663public void DelegateReturnTypeScope(LanguageVersion langVersion) 11702[InlineData(LanguageVersion.CSharp10)] 11703[InlineData(LanguageVersion.CSharp11)] 11704public void TypeScopeModifier_01(LanguageVersion langVersion) 11739var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp10)); 11785var comp = CreateCompilation(source, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp11)); 11892[InlineData(LanguageVersion.CSharp10)] 11893[InlineData(LanguageVersion.CSharp11)] 11894public void PropertyTypeScope(LanguageVersion langVersion) 13321[InlineData(LanguageVersion.CSharp10)] 13322[InlineData(LanguageVersion.CSharp11)] 13323public void LocalScope_05(LanguageVersion langVersion) 13344[InlineData(LanguageVersion.CSharp10)] 13345[InlineData(LanguageVersion.CSharp11)] 13346public void LocalScope_05_For(LanguageVersion langVersion) 13369[InlineData(LanguageVersion.CSharp10)] 13370[InlineData(LanguageVersion.CSharp11)] 13371public void LocalScope_05_Deconstruction(LanguageVersion langVersion) 13389[InlineData(LanguageVersion.CSharp10)] 13390[InlineData(LanguageVersion.CSharp11)] 13391public void LocalScope_05_OutVar(LanguageVersion langVersion) 14633[InlineData(LanguageVersion.CSharp10)] 14634[InlineData(LanguageVersion.CSharp11)] 14635public void LocalScope_01_Foreach_02(LanguageVersion languageVersion) 14905[InlineData(LanguageVersion.CSharp10)] 14906[InlineData(LanguageVersion.CSharp11)] 14907public void LocalScope_01_Foreach_Deconstruction_02(LanguageVersion languageVersion) 15064[InlineData(LanguageVersion.CSharp10)] 15065[InlineData(LanguageVersion.CSharp11)] 15066public void LocalScope_05_Foreach(LanguageVersion langVersion) 16880[InlineData(LanguageVersion.CSharp10)] 16881[InlineData(LanguageVersion.CSharp11)] 16882public void DelegateConversions_14(LanguageVersion languageVersion) 19989[InlineData(LanguageVersion.CSharp10)] 19990[InlineData(LanguageVersion.CSharp11)] 19991public void InstanceMethodWithOutVar_01(LanguageVersion languageVersion) 20049[InlineData(LanguageVersion.CSharp10)] 20050[InlineData(LanguageVersion.CSharp11)] 20051public void InstanceMethodWithOutVar_03(LanguageVersion languageVersion) 20069if (languageVersion == LanguageVersion.CSharp10) 20218[InlineData(LanguageVersion.CSharp10)] 20219[InlineData(LanguageVersion.CSharp11)] 20220public void ReturnThis_01(LanguageVersion languageVersion) 20240[InlineData(LanguageVersion.CSharp10)] 20241[InlineData(LanguageVersion.CSharp11)] 20242public void ReturnThis_02(LanguageVersion languageVersion) 25194[InlineData(LanguageVersion.CSharp10)] 25195[InlineData(LanguageVersion.CSharp11)] 25196public void RefSafetyRulesAttribute_01(LanguageVersion languageVersion) 25219bool useUpdatedRules = languageVersion == LanguageVersion.CSharp11; 25231[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25232[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25262bool useUpdatedRules = languageVersionA == LanguageVersion.CSharp11; 25272[InlineData(LanguageVersion.CSharp10)] 25273[InlineData(LanguageVersion.CSharp11)] 25274public void RefSafetyRulesAttribute_03(LanguageVersion languageVersion) 25296bool useUpdatedRules = languageVersion == LanguageVersion.CSharp11; 25323[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25324[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25346bool useUpdatedRules = languageVersionA == LanguageVersion.CSharp11; 25359[InlineData(LanguageVersion.CSharp10)] 25360[InlineData(LanguageVersion.CSharp11)] 25361public void RefSafetyRulesAttribute_05(LanguageVersion languageVersion) 25381if (languageVersion == LanguageVersion.CSharp11) 25417var scopedRefInCSharp10 = languageVersion == LanguageVersion.CSharp11 ? ScopedKind.None : ScopedKind.ScopedRef; 25430[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25431[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25461if (languageVersionA == LanguageVersion.CSharp11 && 25462languageVersionB == LanguageVersion.CSharp10) 25481[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25482[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25520if (languageVersionA == LanguageVersion.CSharp11 && 25521languageVersionB == LanguageVersion.CSharp10) 25574[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25610[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25611[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25647if (languageVersionA == LanguageVersion.CSharp11 && 25648languageVersionB == LanguageVersion.CSharp10) 25744[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25781if (languageVersionB == LanguageVersion.CSharp10) 25812[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionA, 25860if (languageVersionA == LanguageVersion.CSharp10) 25927[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 25981[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersionB, 27081[InlineData(LanguageVersion.CSharp10, TargetFramework.Net60, false, false)] 27082[InlineData(LanguageVersion.CSharp11, TargetFramework.Net60, false, true)] 27083[InlineData(LanguageVersion.Latest, TargetFramework.Net60, false, true)] 27084[InlineData(LanguageVersion.CSharp10, TargetFramework.Net70, true, true)] 27085[InlineData(LanguageVersion.CSharp11, TargetFramework.Net70, true, true)] 27086[InlineData(LanguageVersion.Latest, TargetFramework.Net70, true, true)] 27087public void UseUpdatedEscapeRules(LanguageVersion languageVersion, TargetFramework targetFramework, bool supportsRefFields, bool expectedUseUpdatedEscapeRules) 27131[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 27178Assert.Equal(languageVersion == LanguageVersion.CSharp11, module.UseUpdatedEscapeRules); 27188[CombinatorialValues(LanguageVersion.CSharp10, LanguageVersion.CSharp11)] LanguageVersion languageVersion, 27230Assert.Equal(languageVersion == LanguageVersion.CSharp11, module.UseUpdatedEscapeRules); 27231Assert.Equal(languageVersion == LanguageVersion.CSharp11, ((SourceModuleSymbol)module).RequiresRefSafetyRulesAttribute()); 27244Assert.Equal(languageVersion == LanguageVersion.CSharp11, module.UseUpdatedEscapeRules); 30308[InlineData(LanguageVersion.CSharp10)] 30309[InlineData(LanguageVersion.CSharp11)] 30310public void ConstructorInitializer_01(LanguageVersion languageVersion) 30363[InlineData(LanguageVersion.CSharp10)] 30364[InlineData(LanguageVersion.CSharp11)] 30365public void FunctionPointerInvocation_01(LanguageVersion languageVersion) 30621[InlineData(LanguageVersion.CSharp10)] 30622[InlineData(LanguageVersion.CSharp11)] 30623public void Discard_03(LanguageVersion languageVersion)
Semantics\RefLocalsAndReturnsTests.cs (12)
266}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 284}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 552}", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 566[InlineData(LanguageVersion.CSharp10)] 567[InlineData(LanguageVersion.CSharp11)] 568public void RefReassignSpanLifetime(LanguageVersion languageVersion) 4936[InlineData(LanguageVersion.CSharp10)] 4937[InlineData(LanguageVersion.CSharp11)] 4939public void RefReturnInvocationOfRefLikeTypeRefResult(LanguageVersion langVersion) 4976[InlineData(LanguageVersion.CSharp10)] 4977[InlineData(LanguageVersion.CSharp11)] 4979public void RefReturnInvocationOfRefLikeTypeRefResult_Repro(LanguageVersion 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 (10)
2175[InlineData(LanguageVersion.CSharp10)] 2176[InlineData(LanguageVersion.CSharp11)] 2177public void PassingSpansToLocals_EscapeScope_01(LanguageVersion languageVersion) 2210[InlineData(LanguageVersion.CSharp10)] 2211[InlineData(LanguageVersion.CSharp11)] 2212public void PassingSpansToLocals_EscapeScope_02(LanguageVersion languageVersion) 2335[InlineData(LanguageVersion.CSharp10)] 2336[InlineData(LanguageVersion.CSharp11)] 2338public void PassingSpansToParameters_Errors(LanguageVersion languageVersion) 2374if (languageVersion == LanguageVersion.CSharp10)
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 (31)
846private static CSharpParseOptions GetParseOptions(LanguageVersion? languageVersion) 854[InlineData(LanguageVersion.CSharp10)] 856public void DefaultThisInitializer_01(LanguageVersion? languageVersion) 914[InlineData(LanguageVersion.CSharp10)] 916public void DefaultThisInitializer_02(LanguageVersion? languageVersion) 983[InlineData(LanguageVersion.CSharp10)] 985public void DefaultThisInitializer_03(LanguageVersion? languageVersion) 1072[InlineData(LanguageVersion.CSharp10)] 1074public void DefaultThisInitializer_04(LanguageVersion? languageVersion) 1167[InlineData(LanguageVersion.CSharp10)] 1169public void DefaultThisInitializer_05(LanguageVersion? languageVersion) 1602[InlineData(LanguageVersion.CSharp10)] 1604public void DefaultThisInitializer_09(LanguageVersion? languageVersion) 1786[InlineData(LanguageVersion.CSharp10)] 1788public void DefaultThisInitializer_12(LanguageVersion? languageVersion) 1880[InlineData(LanguageVersion.CSharp10)] 1882public void DefaultThisInitializer_13(LanguageVersion? languageVersion) 1909[InlineData(LanguageVersion.CSharp10)] 1911public void DefaultThisInitializer_14(LanguageVersion? languageVersion) 3756[InlineData(LanguageVersion.CSharp10)] 3757[InlineData(LanguageVersion.Latest)] 3758public void FieldInitializer_EscapeAnalysis_04(LanguageVersion languageVersion) 4160[InlineData(LanguageVersion.CSharp10)] 4161[InlineData(LanguageVersion.CSharp11)] 4162public void ImplicitlyInitializedFields_EmptyStruct(LanguageVersion languageVersion) 4727[InlineData(LanguageVersion.CSharp10)] 4728[InlineData(LanguageVersion.CSharp11)] 4729public void Struct_ExplicitThisConstructorInitializer_01(LanguageVersion languageVersion) 4758[InlineData(LanguageVersion.CSharp10)] 4759[InlineData(LanguageVersion.CSharp11)] 4760public void Struct_ExplicitThisConstructorInitializer_02(LanguageVersion 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 (10)
180foreach (var langVersion in new[] { LanguageVersion.CSharp8, MessageID.IDS_FeatureTargetTypedConditional.RequiredVersion() }) 205foreach (var langVersion in new[] { LanguageVersion.CSharp8, MessageID.IDS_FeatureTargetTypedConditional.RequiredVersion() }) 227foreach (var langVersion in new[] { LanguageVersion.CSharp8, MessageID.IDS_FeatureTargetTypedConditional.RequiredVersion() }) 263foreach (var langVersion in new[] { LanguageVersion.CSharp8, MessageID.IDS_FeatureTargetTypedConditional.RequiredVersion() }) 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 (38)
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\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2750var tree = SyntaxFactory.ParseSyntaxTree(test, options: new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6));
Compilation\UsedAssembliesTests.cs (3)
190LanguageVersion treeLanguageVersion = ((CSharpParseOptions)tree.Options).LanguageVersion; 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);
DocumentationComments\ParameterTests.cs (2)
829CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp2)).VerifyDiagnostics( 834CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.Latest)).VerifyDiagnostics();
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 (3)
273CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 307CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 328CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7)).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 (1312)
Diagnostics\DiagnosticTest.cs (1)
120verifyWithSeverity(new LazyUseSiteDiagnosticsInfoForNullableType(LanguageVersion.CSharp11, type));
IncrementalParsing\ChangingAsync.cs (2)
61ParseAndValidate(text, validator, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp5)); 62ParseAndValidate(text, validator, TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp5));
IncrementalParsing\IncrementalParsingTests.cs (4)
23return new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3, preprocessorSymbols: defines); 33private SyntaxTree Parse(string text, LanguageVersion languageVersion) 41=> Parse(text, LanguageVersion.CSharp6); 44=> Parse(text, LanguageVersion.Preview);
LexicalAndXml\LexicalTests.cs (4)
32_options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3); 33_options6 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6); 34_options7 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp7); 35_options72 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp7_2);
LexicalAndXml\PreprocessorTests.cs (8)
77return new CSharpParseOptions(languageVersion: LanguageVersion.CSharp4, kind: kind, preprocessorSymbols: defines); 3223[InlineData(LanguageVersion.CSharp4, "4")] 3224[InlineData(LanguageVersion.CSharp9, "9.0")] 3225[InlineData(LanguageVersion.Latest, "latest (13.0)")] 3226[InlineData(LanguageVersion.LatestMajor, "latestmajor (13.0)")] 3227[InlineData(LanguageVersion.Default, "default (13.0)")] 3228[InlineData(LanguageVersion.Preview, "preview")] 3229public void TestErrorWithVersion(LanguageVersion version, string expectedLanguageVersion)
LexicalAndXml\XmlDocCommentTests.cs (1)
26languageVersion: LanguageVersion.CSharp3,
Parsing\AsyncParsingTests.cs (4)
21return SyntaxFactory.ParseSyntaxTree(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5)); 26return SyntaxFactory.ParseExpression(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5)); 31foreach (LanguageVersion version in Enum.GetValues(typeof(LanguageVersion)))
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 (3)
18[InlineData(LanguageVersion.CSharp11)] 19[InlineData(LanguageVersion.Preview)] 20public void CollectionExpressionParsingDoesNotProduceLangVersionError(LanguageVersion languageVersion)
Parsing\CrefParsingTests.cs (24)
1467[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1494[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1521[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1556[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1591[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1630[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion)
Parsing\CSharpParseOptionsTests.cs (3)
45TestProperty((old, value) => old.WithLanguageVersion(value), opt => opt.LanguageVersion, LanguageVersion.CSharp3); 173var options = new CSharpParseOptions(languageVersion: unchecked((LanguageVersion)10000)); 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 (677)
19[InlineData(LanguageVersion.CSharp10)] 20[InlineData(LanguageVersion.CSharp11)] 21public void Method_01(LanguageVersion langVersion) 66[InlineData(LanguageVersion.CSharp10)] 67[InlineData(LanguageVersion.CSharp11)] 68public void Method_02(LanguageVersion langVersion) 137[InlineData(LanguageVersion.CSharp10)] 138[InlineData(LanguageVersion.CSharp11)] 139public void Method_03(LanguageVersion langVersion) 305[InlineData(LanguageVersion.CSharp10)] 306[InlineData(LanguageVersion.CSharp11)] 307public void Method_06(LanguageVersion langVersion) 424[InlineData(LanguageVersion.CSharp10)] 425[InlineData(LanguageVersion.CSharp11)] 426public void Method_06_Escaped(LanguageVersion langVersion) 593[InlineData(LanguageVersion.CSharp10)] 594[InlineData(LanguageVersion.CSharp11)] 595public void Method_09(LanguageVersion langVersion) 678[InlineData(LanguageVersion.CSharp10)] 679[InlineData(LanguageVersion.CSharp11)] 680public void Method_10(LanguageVersion langVersion) 741[InlineData(LanguageVersion.CSharp10)] 742[InlineData(LanguageVersion.CSharp11)] 743public void Method_11(LanguageVersion langVersion) 795[InlineData(LanguageVersion.CSharp10)] 796[InlineData(LanguageVersion.CSharp11)] 797public void Method_12(LanguageVersion langVersion) 835[InlineData(LanguageVersion.CSharp10)] 836[InlineData(LanguageVersion.CSharp11)] 837public void Method_13(LanguageVersion langVersion) 890[InlineData(LanguageVersion.CSharp10)] 891[InlineData(LanguageVersion.CSharp11)] 892public void Lambda_01(LanguageVersion langVersion) 932[InlineData(LanguageVersion.CSharp10)] 933[InlineData(LanguageVersion.CSharp11)] 934public void Lambda_02(LanguageVersion langVersion) 998[InlineData(LanguageVersion.CSharp10)] 999[InlineData(LanguageVersion.CSharp11)] 1000public void Lambda_03_Ref(LanguageVersion langVersion) 1032[InlineData(LanguageVersion.CSharp10)] 1033[InlineData(LanguageVersion.CSharp11)] 1034public void Lambda_03_In(LanguageVersion langVersion) 1062[InlineData(LanguageVersion.CSharp10)] 1063[InlineData(LanguageVersion.CSharp11)] 1064public void Lambda_03_Out(LanguageVersion langVersion) 1092[InlineData(LanguageVersion.CSharp10)] 1093[InlineData(LanguageVersion.CSharp11)] 1094public void Lambda_04(LanguageVersion langVersion) 1193[InlineData(LanguageVersion.CSharp10)] 1194[InlineData(LanguageVersion.CSharp11)] 1195public void Lambda_07(LanguageVersion langVersion) 1261[InlineData(LanguageVersion.CSharp10)] 1262[InlineData(LanguageVersion.CSharp11)] 1263public void Lambda_08(LanguageVersion langVersion) 1394[InlineData(LanguageVersion.CSharp10)] 1395[InlineData(LanguageVersion.CSharp11)] 1396public void Local_01(LanguageVersion langVersion) 1531[InlineData(LanguageVersion.CSharp10)] 1532[InlineData(LanguageVersion.CSharp11)] 1533public void Local_01_Escaped(LanguageVersion langVersion) 1599[InlineData(LanguageVersion.CSharp10)] 1600[InlineData(LanguageVersion.CSharp11)] 1601public void Local_02(LanguageVersion langVersion) 1716[InlineData(LanguageVersion.CSharp10)] 1717[InlineData(LanguageVersion.CSharp11)] 1718public void Local_02_RefScoped(LanguageVersion langVersion) 1848[InlineData(LanguageVersion.CSharp10)] 1849[InlineData(LanguageVersion.CSharp11)] 1850public void Local_03(LanguageVersion langVersion) 1914[InlineData(LanguageVersion.CSharp10)] 1915[InlineData(LanguageVersion.CSharp11)] 1916public void Local_03_RefScoped(LanguageVersion langVersion) 1964[InlineData(LanguageVersion.CSharp10)] 1965[InlineData(LanguageVersion.CSharp11)] 1966public void Local_04(LanguageVersion langVersion) 2008[InlineData(LanguageVersion.CSharp10)] 2009[InlineData(LanguageVersion.CSharp11)] 2010public void Local_04_RefScoped(LanguageVersion langVersion) 2083[InlineData(LanguageVersion.CSharp10)] 2084[InlineData(LanguageVersion.CSharp11)] 2085public void Local_05(LanguageVersion langVersion) 2141[InlineData(LanguageVersion.CSharp10)] 2142[InlineData(LanguageVersion.CSharp11)] 2143public void TypeNamedScoped(LanguageVersion langVersion) 2165[InlineData(LanguageVersion.CSharp10)] 2166[InlineData(LanguageVersion.CSharp11)] 2167public void TypeNamedScoped_Escaped(LanguageVersion langVersion) 2189[InlineData(LanguageVersion.CSharp10)] 2190[InlineData(LanguageVersion.CSharp11)] 2191public void Local_06(LanguageVersion langVersion) 2295[InlineData(LanguageVersion.CSharp10)] 2296[InlineData(LanguageVersion.CSharp11)] 2297public void Local_06_Escaped(LanguageVersion langVersion) 2401[InlineData(LanguageVersion.CSharp10)] 2402[InlineData(LanguageVersion.CSharp11)] 2403public void Local_07(LanguageVersion langVersion) 2495[InlineData(LanguageVersion.CSharp10)] 2496[InlineData(LanguageVersion.CSharp11)] 2497public void Local_07_WithInitializer(LanguageVersion langVersion) 2542[InlineData(LanguageVersion.CSharp10)] 2543[InlineData(LanguageVersion.CSharp11)] 2544public void Local_07_RefScoped(LanguageVersion langVersion) 2612[InlineData(LanguageVersion.CSharp10)] 2613[InlineData(LanguageVersion.CSharp11)] 2614public void Local_08(LanguageVersion langVersion) 2678[InlineData(LanguageVersion.CSharp10)] 2679[InlineData(LanguageVersion.CSharp11)] 2680public void Local_08_RefScoped(LanguageVersion langVersion) 2721[InlineData(LanguageVersion.CSharp10)] 2722[InlineData(LanguageVersion.CSharp11)] 2723public void Local_09(LanguageVersion langVersion) 2765[InlineData(LanguageVersion.CSharp10)] 2766[InlineData(LanguageVersion.CSharp11)] 2767public void Local_09_RefReadonlyScoped(LanguageVersion langVersion) 2840[InlineData(LanguageVersion.CSharp10)] 2841[InlineData(LanguageVersion.CSharp11)] 2842public void Local_10(LanguageVersion langVersion) 3011[InlineData(LanguageVersion.CSharp10)] 3012[InlineData(LanguageVersion.CSharp11)] 3013public void Local_13(LanguageVersion langVersion) 3158[InlineData(LanguageVersion.CSharp10)] 3159[InlineData(LanguageVersion.CSharp11)] 3160public void Local_15(LanguageVersion langVersion) 3249[InlineData(LanguageVersion.CSharp8)] 3250[InlineData(LanguageVersion.CSharp10)] 3251[InlineData(LanguageVersion.CSharp11)] 3252public void Local_16(LanguageVersion langVersion) 3260if (langVersion == LanguageVersion.CSharp8) 3276else if (langVersion == LanguageVersion.CSharp10) 3289else if (langVersion == LanguageVersion.CSharp11) 3480[InlineData(LanguageVersion.CSharp10)] 3481[InlineData(LanguageVersion.CSharp11)] 3482public void DeclExpr_01(LanguageVersion langVersion) 3547[InlineData(LanguageVersion.CSharp10)] 3548[InlineData(LanguageVersion.CSharp11)] 3549public void DeclExpr_02(LanguageVersion langVersion) 3618[InlineData(LanguageVersion.CSharp10)] 3619[InlineData(LanguageVersion.CSharp11)] 3620public void DeclExpr_03(LanguageVersion langVersion) 3694[InlineData(LanguageVersion.CSharp10)] 3695[InlineData(LanguageVersion.CSharp11)] 3696public void DeclExpr_04(LanguageVersion langVersion) 3770[InlineData(LanguageVersion.CSharp10)] 3771[InlineData(LanguageVersion.CSharp11)] 3772public void DeclExpr_05(LanguageVersion langVersion) 3842[InlineData(LanguageVersion.CSharp10)] 3843[InlineData(LanguageVersion.CSharp11)] 3844public void DeclExpr_06(LanguageVersion langVersion) 3929[InlineData(LanguageVersion.CSharp10)] 3930[InlineData(LanguageVersion.CSharp11)] 3931public void DeclExpr_07(LanguageVersion langVersion) 4009[InlineData(LanguageVersion.CSharp10)] 4010[InlineData(LanguageVersion.CSharp11)] 4011public void DeclExpr_08(LanguageVersion langVersion) 4080[InlineData(LanguageVersion.CSharp10)] 4081[InlineData(LanguageVersion.CSharp11)] 4082public void DeclExpr_09(LanguageVersion langVersion) 4149[InlineData(LanguageVersion.CSharp10)] 4150[InlineData(LanguageVersion.CSharp11)] 4151public void DeclExpr_10(LanguageVersion langVersion) 4224[InlineData(LanguageVersion.CSharp10)] 4225[InlineData(LanguageVersion.CSharp11)] 4226public void DeclExpr_11(LanguageVersion langVersion) 4297[InlineData(LanguageVersion.CSharp10)] 4298[InlineData(LanguageVersion.CSharp11)] 4299public void DeclExpr_12(LanguageVersion langVersion) 4373[InlineData(LanguageVersion.CSharp10)] 4374[InlineData(LanguageVersion.CSharp11)] 4375public void DeclExpr_13(LanguageVersion langVersion) 4447[InlineData(LanguageVersion.CSharp10)] 4448[InlineData(LanguageVersion.CSharp11)] 4449public void DeclExpr_14(LanguageVersion langVersion) 4518[InlineData(LanguageVersion.CSharp10)] 4519[InlineData(LanguageVersion.CSharp11)] 4520public void DeclExpr_15(LanguageVersion langVersion) 4593[InlineData(LanguageVersion.CSharp10)] 4594[InlineData(LanguageVersion.CSharp11)] 4595public void DeclExpr_16(LanguageVersion langVersion) 4669[InlineData(LanguageVersion.CSharp10)] 4670[InlineData(LanguageVersion.CSharp11)] 4671public void DeclExpr_17(LanguageVersion langVersion) 4744[InlineData(LanguageVersion.CSharp10)] 4745[InlineData(LanguageVersion.CSharp11)] 4746public void DeclExpr_18(LanguageVersion langVersion) 4815[InlineData(LanguageVersion.CSharp10)] 4816[InlineData(LanguageVersion.CSharp11)] 4817public void DeclExpr_20(LanguageVersion langVersion) 4886[InlineData(LanguageVersion.CSharp10)] 4887[InlineData(LanguageVersion.CSharp11)] 4888public void DeclExpr_21(LanguageVersion langVersion) 4961[InlineData(LanguageVersion.CSharp10)] 4962[InlineData(LanguageVersion.CSharp11)] 4963public void DeclExpr_22(LanguageVersion langVersion) 5037[InlineData(LanguageVersion.CSharp10)] 5038[InlineData(LanguageVersion.CSharp11)] 5039public void DeclExpr_23(LanguageVersion langVersion) 5104[InlineData(LanguageVersion.CSharp10)] 5105[InlineData(LanguageVersion.CSharp11)] 5106public void DeclExpr_24(LanguageVersion langVersion) 5175[InlineData(LanguageVersion.CSharp10)] 5176[InlineData(LanguageVersion.CSharp11)] 5177public void DeclExpr_25(LanguageVersion langVersion) 5248[InlineData(LanguageVersion.CSharp10)] 5249[InlineData(LanguageVersion.CSharp11)] 5250public void DeclExpr_26(LanguageVersion langVersion) 5321[InlineData(LanguageVersion.CSharp10)] 5322[InlineData(LanguageVersion.CSharp11)] 5323public void DeclExpr_27(LanguageVersion langVersion) 5405[InlineData(LanguageVersion.CSharp10)] 5406[InlineData(LanguageVersion.CSharp11)] 5407public void DeclExpr_28(LanguageVersion langVersion) 5474[InlineData(LanguageVersion.CSharp10)] 5475[InlineData(LanguageVersion.CSharp11)] 5476public void DeclExpr_29(LanguageVersion langVersion) 5544[InlineData(LanguageVersion.CSharp10)] 5545[InlineData(LanguageVersion.CSharp11)] 5546public void DeclExpr_30(LanguageVersion langVersion) 5623[InlineData(LanguageVersion.CSharp10)] 5624[InlineData(LanguageVersion.CSharp11)] 5625public void DeclExpr_31(LanguageVersion langVersion) 5694[InlineData(LanguageVersion.CSharp10)] 5695[InlineData(LanguageVersion.CSharp11)] 5696public void DeclExpr_32(LanguageVersion langVersion) 5773[InlineData(LanguageVersion.CSharp10)] 5774[InlineData(LanguageVersion.CSharp11)] 5775public void DeclExpr_33(LanguageVersion langVersion) 5894[InlineData(LanguageVersion.CSharp10)] 5895[InlineData(LanguageVersion.CSharp11)] 5896public void OutDeclExpr_01(LanguageVersion langVersion) 5946[InlineData(LanguageVersion.CSharp10)] 5947[InlineData(LanguageVersion.CSharp11)] 5948public void OutDeclExpr_02(LanguageVersion langVersion) 6002[InlineData(LanguageVersion.CSharp10)] 6003[InlineData(LanguageVersion.CSharp11)] 6004public void OutDeclExpr_03(LanguageVersion langVersion) 6080[InlineData(LanguageVersion.CSharp10)] 6081[InlineData(LanguageVersion.CSharp11)] 6082public void OutDeclExpr_04(LanguageVersion langVersion) 6148[InlineData(LanguageVersion.CSharp10)] 6149[InlineData(LanguageVersion.CSharp11)] 6150public void OutDeclExpr_05(LanguageVersion langVersion) 6205[InlineData(LanguageVersion.CSharp10)] 6206[InlineData(LanguageVersion.CSharp11)] 6207public void OutDeclExpr_06(LanguageVersion langVersion) 6295[InlineData(LanguageVersion.CSharp10)] 6296[InlineData(LanguageVersion.CSharp11)] 6297public void OutDeclExpr_07(LanguageVersion langVersion) 6378[InlineData(LanguageVersion.CSharp10)] 6379[InlineData(LanguageVersion.CSharp11)] 6380public void OutDeclExpr_08(LanguageVersion langVersion) 6434[InlineData(LanguageVersion.CSharp10)] 6435[InlineData(LanguageVersion.CSharp11)] 6436public void OutDeclExpr_09(LanguageVersion langVersion) 6505[InlineData(LanguageVersion.CSharp10)] 6506[InlineData(LanguageVersion.CSharp11)] 6507public void OutDeclExpr_10(LanguageVersion langVersion) 6565[InlineData(LanguageVersion.CSharp10)] 6566[InlineData(LanguageVersion.CSharp11)] 6567public void OutDeclExpr_11(LanguageVersion langVersion) 6637[InlineData(LanguageVersion.CSharp10)] 6638[InlineData(LanguageVersion.CSharp11)] 6639public void OutDeclExpr_12(LanguageVersion langVersion) 6698[InlineData(LanguageVersion.CSharp10)] 6699[InlineData(LanguageVersion.CSharp11)] 6700public void OutDeclExpr_13(LanguageVersion langVersion) 6789[InlineData(LanguageVersion.CSharp10)] 6790[InlineData(LanguageVersion.CSharp11)] 6791public void OutDeclExpr_14(LanguageVersion langVersion) 6845[InlineData(LanguageVersion.CSharp10)] 6846[InlineData(LanguageVersion.CSharp11)] 6847public void OutDeclExpr_15(LanguageVersion langVersion) 6905[InlineData(LanguageVersion.CSharp10)] 6906[InlineData(LanguageVersion.CSharp11)] 6907public void OutDeclExpr_16(LanguageVersion langVersion) 6966[InlineData(LanguageVersion.CSharp10)] 6967[InlineData(LanguageVersion.CSharp11)] 6968public void OutDeclExpr_17(LanguageVersion langVersion) 7026[InlineData(LanguageVersion.CSharp10)] 7027[InlineData(LanguageVersion.CSharp11)] 7028public void OutDeclExpr_18(LanguageVersion langVersion) 7082[InlineData(LanguageVersion.CSharp10)] 7083[InlineData(LanguageVersion.CSharp11)] 7084public void OutDeclExpr_20(LanguageVersion langVersion) 7138[InlineData(LanguageVersion.CSharp10)] 7139[InlineData(LanguageVersion.CSharp11)] 7140public void OutDeclExpr_21(LanguageVersion langVersion) 7198[InlineData(LanguageVersion.CSharp10)] 7199[InlineData(LanguageVersion.CSharp11)] 7200public void OutDeclExpr_22(LanguageVersion langVersion) 7259[InlineData(LanguageVersion.CSharp10)] 7260[InlineData(LanguageVersion.CSharp11)] 7261public void OutDeclExpr_23(LanguageVersion langVersion) 7311[InlineData(LanguageVersion.CSharp10)] 7312[InlineData(LanguageVersion.CSharp11)] 7313public void OutDeclExpr_24(LanguageVersion langVersion) 7367[InlineData(LanguageVersion.CSharp10)] 7368[InlineData(LanguageVersion.CSharp11)] 7369public void OutDeclExpr_25(LanguageVersion langVersion) 7445[InlineData(LanguageVersion.CSharp10)] 7446[InlineData(LanguageVersion.CSharp11)] 7447public void OutDeclExpr_26(LanguageVersion langVersion) 7513[InlineData(LanguageVersion.CSharp10)] 7514[InlineData(LanguageVersion.CSharp11)] 7515public void OutDeclExpr_27(LanguageVersion langVersion) 7585[InlineData(LanguageVersion.CSharp10)] 7586[InlineData(LanguageVersion.CSharp11)] 7587public void OutDeclExpr_28(LanguageVersion langVersion) 7655[InlineData(LanguageVersion.CSharp10)] 7656[InlineData(LanguageVersion.CSharp11)] 7657public void OutDeclExpr_29(LanguageVersion langVersion) 7726[InlineData(LanguageVersion.CSharp10)] 7727[InlineData(LanguageVersion.CSharp11)] 7728public void OutDeclExpr_30(LanguageVersion langVersion) 7798[InlineData(LanguageVersion.CSharp10)] 7799[InlineData(LanguageVersion.CSharp11)] 7800public void OutDeclExpr_31(LanguageVersion langVersion) 7865[InlineData(LanguageVersion.CSharp10)] 7866[InlineData(LanguageVersion.CSharp11)] 7867public void OutDeclExpr_32(LanguageVersion langVersion) 7933[InlineData(LanguageVersion.CSharp10)] 7934[InlineData(LanguageVersion.CSharp11)] 7935public void OutDeclExpr_33(LanguageVersion langVersion) 7989[InlineData(LanguageVersion.CSharp10)] 7990[InlineData(LanguageVersion.CSharp11)] 7991public void OutDeclExpr_34(LanguageVersion langVersion) 8041[InlineData(LanguageVersion.CSharp10)] 8042[InlineData(LanguageVersion.CSharp11)] 8043public void New_01(LanguageVersion langVersion) 8080[InlineData(LanguageVersion.CSharp10)] 8081[InlineData(LanguageVersion.CSharp11)] 8082public void New_02(LanguageVersion langVersion) 8148[InlineData(LanguageVersion.CSharp10)] 8149[InlineData(LanguageVersion.CSharp11)] 8150public void New_03(LanguageVersion langVersion) 8182[InlineData(LanguageVersion.CSharp10)] 8183[InlineData(LanguageVersion.CSharp11)] 8184public void New_04(LanguageVersion langVersion) 8245[InlineData(LanguageVersion.CSharp10)] 8246[InlineData(LanguageVersion.CSharp11)] 8247public void New_05(LanguageVersion langVersion) 8312[InlineData(LanguageVersion.CSharp10)] 8313[InlineData(LanguageVersion.CSharp11)] 8314public void New_06(LanguageVersion langVersion) 8350[InlineData(LanguageVersion.CSharp10)] 8351[InlineData(LanguageVersion.CSharp11)] 8352public void For_01(LanguageVersion langVersion) 8387[InlineData(LanguageVersion.CSharp10)] 8388[InlineData(LanguageVersion.CSharp11)] 8389public void For_02(LanguageVersion langVersion) 8428[InlineData(LanguageVersion.CSharp10)] 8429[InlineData(LanguageVersion.CSharp11)] 8430public void For_03(LanguageVersion langVersion) 8476[InlineData(LanguageVersion.CSharp10)] 8477[InlineData(LanguageVersion.CSharp11)] 8478public void For_04(LanguageVersion langVersion) 8521[InlineData(LanguageVersion.CSharp10)] 8522[InlineData(LanguageVersion.CSharp11)] 8523public void For_05(LanguageVersion langVersion) 8563[InlineData(LanguageVersion.CSharp10)] 8564[InlineData(LanguageVersion.CSharp11)] 8565public void For_06(LanguageVersion langVersion) 8612[InlineData(LanguageVersion.CSharp10)] 8613[InlineData(LanguageVersion.CSharp11)] 8614public void For_07(LanguageVersion langVersion) 8660[InlineData(LanguageVersion.CSharp10)] 8661[InlineData(LanguageVersion.CSharp11)] 8662public void For_08(LanguageVersion langVersion) 8701[InlineData(LanguageVersion.CSharp10)] 8702[InlineData(LanguageVersion.CSharp11)] 8703public void For_09(LanguageVersion langVersion) 8751[InlineData(LanguageVersion.CSharp10)] 8752[InlineData(LanguageVersion.CSharp11)] 8753public void For_10(LanguageVersion langVersion) 8796[InlineData(LanguageVersion.CSharp10)] 8797[InlineData(LanguageVersion.CSharp11)] 8798public void For_11(LanguageVersion langVersion) 8853[InlineData(LanguageVersion.CSharp10)] 8854[InlineData(LanguageVersion.CSharp11)] 8855public void For_12(LanguageVersion langVersion) 8899[InlineData(LanguageVersion.CSharp10)] 8900[InlineData(LanguageVersion.CSharp11)] 8901public void For_13(LanguageVersion langVersion) 8970[InlineData(LanguageVersion.CSharp10)] 8971[InlineData(LanguageVersion.CSharp11)] 8972public void For_14(LanguageVersion langVersion) 9011[InlineData(LanguageVersion.CSharp10)] 9012[InlineData(LanguageVersion.CSharp11)] 9013public void For_15(LanguageVersion langVersion) 9056[InlineData(LanguageVersion.CSharp10)] 9057[InlineData(LanguageVersion.CSharp11)] 9058public void For_16(LanguageVersion langVersion) 9102[InlineData(LanguageVersion.CSharp10)] 9103[InlineData(LanguageVersion.CSharp11)] 9104public void For_17(LanguageVersion langVersion) 9147[InlineData(LanguageVersion.CSharp10)] 9148[InlineData(LanguageVersion.CSharp11)] 9149public void For_18(LanguageVersion langVersion) 9188[InlineData(LanguageVersion.CSharp10)] 9189[InlineData(LanguageVersion.CSharp11)] 9190public void For_19(LanguageVersion langVersion) 9237[InlineData(LanguageVersion.CSharp10)] 9238[InlineData(LanguageVersion.CSharp11)] 9239public void For_20(LanguageVersion langVersion) 9278[InlineData(LanguageVersion.CSharp10)] 9279[InlineData(LanguageVersion.CSharp11)] 9280public void For_21(LanguageVersion langVersion) 9324[InlineData(LanguageVersion.CSharp10)] 9325[InlineData(LanguageVersion.CSharp11)] 9326public void For_22(LanguageVersion langVersion) 9370[InlineData(LanguageVersion.CSharp10)] 9371[InlineData(LanguageVersion.CSharp11)] 9372public void For_23(LanguageVersion langVersion) 9407[InlineData(LanguageVersion.CSharp10)] 9408[InlineData(LanguageVersion.CSharp11)] 9409public void For_24(LanguageVersion langVersion) 9448[InlineData(LanguageVersion.CSharp10)] 9449[InlineData(LanguageVersion.CSharp11)] 9450public void For_25(LanguageVersion langVersion) 9489[InlineData(LanguageVersion.CSharp10)] 9490[InlineData(LanguageVersion.CSharp11)] 9491public void For_26(LanguageVersion langVersion) 9534[InlineData(LanguageVersion.CSharp10)] 9535[InlineData(LanguageVersion.CSharp11)] 9536public void FunctionPointer_01(LanguageVersion langVersion) 9582[InlineData(LanguageVersion.CSharp10)] 9583[InlineData(LanguageVersion.CSharp11)] 9584public void FunctionPointer_02(LanguageVersion langVersion) 9653[InlineData(LanguageVersion.CSharp10)] 9654[InlineData(LanguageVersion.CSharp11)] 9655public void Foreach_01(LanguageVersion langVersion) 9687[InlineData(LanguageVersion.CSharp10)] 9688[InlineData(LanguageVersion.CSharp11)] 9689public void Foreach_02(LanguageVersion langVersion) 9725[InlineData(LanguageVersion.CSharp10)] 9726[InlineData(LanguageVersion.CSharp11)] 9727public void Foreach_04(LanguageVersion langVersion) 9788[InlineData(LanguageVersion.CSharp10)] 9789[InlineData(LanguageVersion.CSharp11)] 9790public void Foreach_05(LanguageVersion langVersion) 9827[InlineData(LanguageVersion.CSharp10)] 9828[InlineData(LanguageVersion.CSharp11)] 9829public void Foreach_06(LanguageVersion langVersion) 9904[InlineData(LanguageVersion.CSharp10)] 9905[InlineData(LanguageVersion.CSharp11)] 9906public void Foreach_07(LanguageVersion langVersion) 9974[InlineData(LanguageVersion.CSharp10)] 9975[InlineData(LanguageVersion.CSharp11)] 9976public void Foreach_08(LanguageVersion langVersion) 10012[InlineData(LanguageVersion.CSharp10)] 10013[InlineData(LanguageVersion.CSharp11)] 10014public void Foreach_09(LanguageVersion langVersion) 10068[InlineData(LanguageVersion.CSharp10)] 10069[InlineData(LanguageVersion.CSharp11)] 10070public void Foreach_10(LanguageVersion langVersion) 10110[InlineData(LanguageVersion.CSharp10)] 10111[InlineData(LanguageVersion.CSharp11)] 10112public void Foreach_11(LanguageVersion langVersion) 10173[InlineData(LanguageVersion.CSharp10)] 10174[InlineData(LanguageVersion.CSharp11)] 10175public void Foreach_12(LanguageVersion langVersion) 10216[InlineData(LanguageVersion.CSharp10)] 10217[InlineData(LanguageVersion.CSharp11)] 10218public void Foreach_13(LanguageVersion langVersion) 10286[InlineData(LanguageVersion.CSharp10)] 10287[InlineData(LanguageVersion.CSharp11)] 10288public void Foreach_14(LanguageVersion langVersion) 10324[InlineData(LanguageVersion.CSharp10)] 10325[InlineData(LanguageVersion.CSharp11)] 10326public void Foreach_15(LanguageVersion langVersion) 10366[InlineData(LanguageVersion.CSharp10)] 10367[InlineData(LanguageVersion.CSharp11)] 10368public void Foreach_16(LanguageVersion langVersion) 10409[InlineData(LanguageVersion.CSharp10)] 10410[InlineData(LanguageVersion.CSharp11)] 10411public void Foreach_17(LanguageVersion langVersion) 10451[InlineData(LanguageVersion.CSharp10)] 10452[InlineData(LanguageVersion.CSharp11)] 10453public void Foreach_18(LanguageVersion langVersion) 10489[InlineData(LanguageVersion.CSharp10)] 10490[InlineData(LanguageVersion.CSharp11)] 10491public void Foreach_20(LanguageVersion langVersion) 10527[InlineData(LanguageVersion.CSharp10)] 10528[InlineData(LanguageVersion.CSharp11)] 10529public void Foreach_21(LanguageVersion langVersion) 10569[InlineData(LanguageVersion.CSharp10)] 10570[InlineData(LanguageVersion.CSharp11)] 10571public void Foreach_22(LanguageVersion langVersion) 10612[InlineData(LanguageVersion.CSharp10)] 10613[InlineData(LanguageVersion.CSharp11)] 10614public void Foreach_23(LanguageVersion langVersion) 10646[InlineData(LanguageVersion.CSharp10)] 10647[InlineData(LanguageVersion.CSharp11)] 10648public void Foreach_24(LanguageVersion langVersion) 10684[InlineData(LanguageVersion.CSharp10)] 10685[InlineData(LanguageVersion.CSharp11)] 10686public void Foreach_25(LanguageVersion langVersion) 10738[InlineData(LanguageVersion.CSharp10)] 10739[InlineData(LanguageVersion.CSharp11)] 10740public void Foreach_26(LanguageVersion langVersion) 10796[InlineData(LanguageVersion.CSharp10)] 10797[InlineData(LanguageVersion.CSharp11)] 10798public void Foreach_27(LanguageVersion langVersion) 10866[InlineData(LanguageVersion.CSharp10)] 10867[InlineData(LanguageVersion.CSharp11)] 10868public void Foreach_28(LanguageVersion langVersion) 10954[InlineData(LanguageVersion.CSharp10)] 10955[InlineData(LanguageVersion.CSharp11)] 10956public void Foreach_29(LanguageVersion langVersion) 11008[InlineData(LanguageVersion.CSharp10)] 11009[InlineData(LanguageVersion.CSharp11)] 11010public void Foreach_30(LanguageVersion langVersion) 11109[InlineData(LanguageVersion.CSharp10)] 11110[InlineData(LanguageVersion.CSharp11)] 11111public void Type_01(LanguageVersion langVersion) 11351[InlineData(LanguageVersion.CSharp10)] 11352[InlineData(LanguageVersion.CSharp11)] 11353public void Type_04(LanguageVersion langVersion) 11383[InlineData(LanguageVersion.CSharp10)] 11384[InlineData(LanguageVersion.CSharp11)] 11385public void Type_05(LanguageVersion langVersion) 11471[InlineData(LanguageVersion.CSharp10)] 11472[InlineData(LanguageVersion.CSharp11)] 11473public void Type_06(LanguageVersion langVersion) 11507[InlineData(LanguageVersion.CSharp10)] 11508[InlineData(LanguageVersion.CSharp11)] 11509public void Type_07(LanguageVersion langVersion) 11597[InlineData(LanguageVersion.CSharp10)] 11598[InlineData(LanguageVersion.CSharp11)] 11599public void LocalAssignment_01(LanguageVersion langVersion) 11677[InlineData(LanguageVersion.CSharp10)] 11678[InlineData(LanguageVersion.CSharp11)] 11679public void LocalAssignment_02(LanguageVersion langVersion) 11732[InlineData(LanguageVersion.CSharp10)] 11733[InlineData(LanguageVersion.CSharp11)] 11734public void Using_01(LanguageVersion langVersion) 11792[InlineData(LanguageVersion.CSharp10)] 11793[InlineData(LanguageVersion.CSharp11)] 11794public void Using_02(LanguageVersion langVersion) 11832[InlineData(LanguageVersion.CSharp10)] 11833[InlineData(LanguageVersion.CSharp11)] 11834public void Using_02_RefScoped(LanguageVersion langVersion) 11887[InlineData(LanguageVersion.CSharp10)] 11888[InlineData(LanguageVersion.CSharp11)] 11889public void Using_03(LanguageVersion langVersion) 11978[InlineData(LanguageVersion.CSharp10)] 11979[InlineData(LanguageVersion.CSharp11)] 11980public void Using_04(LanguageVersion langVersion) 12019[InlineData(LanguageVersion.CSharp10)] 12020[InlineData(LanguageVersion.CSharp11)] 12021public void Using_04_RefScoped(LanguageVersion langVersion) 12075[InlineData(LanguageVersion.CSharp10)] 12076[InlineData(LanguageVersion.CSharp11)] 12077public void Using_05(LanguageVersion langVersion) 12119[InlineData(LanguageVersion.CSharp10)] 12120[InlineData(LanguageVersion.CSharp11)] 12121public void Using_06(LanguageVersion langVersion) 12164[InlineData(LanguageVersion.CSharp10)] 12165[InlineData(LanguageVersion.CSharp11)] 12166public void UsingStmt_01(LanguageVersion langVersion) 12206[InlineData(LanguageVersion.CSharp10)] 12207[InlineData(LanguageVersion.CSharp11)] 12208public void UsingStmt_02(LanguageVersion langVersion) 12252[InlineData(LanguageVersion.CSharp10)] 12253[InlineData(LanguageVersion.CSharp11)] 12254public void UsingStmt_03(LanguageVersion langVersion) 12311[InlineData(LanguageVersion.CSharp10)] 12312[InlineData(LanguageVersion.CSharp11)] 12313public void UsingStmt_04(LanguageVersion langVersion) 12378[InlineData(LanguageVersion.CSharp10)] 12379[InlineData(LanguageVersion.CSharp11)] 12380public void UsingStmt_05(LanguageVersion langVersion) 12425[InlineData(LanguageVersion.CSharp10)] 12426[InlineData(LanguageVersion.CSharp11)] 12427public void UsingStmt_06(LanguageVersion langVersion) 12495[InlineData(LanguageVersion.CSharp10)] 12496[InlineData(LanguageVersion.CSharp11)] 12497public void UsingStmt_07(LanguageVersion langVersion) 12558[InlineData(LanguageVersion.CSharp10)] 12559[InlineData(LanguageVersion.CSharp11)] 12560public void UsingStmt_08(LanguageVersion langVersion) 12604[InlineData(LanguageVersion.CSharp10)] 12605[InlineData(LanguageVersion.CSharp11)] 12606public void UsingStmt_09(LanguageVersion langVersion) 12656[InlineData(LanguageVersion.CSharp10)] 12657[InlineData(LanguageVersion.CSharp11)] 12658public void UsingStmt_10(LanguageVersion langVersion) 12706[InlineData(LanguageVersion.CSharp10)] 12707[InlineData(LanguageVersion.CSharp11)] 12708public void UsingStmt_11(LanguageVersion langVersion) 12762[InlineData(LanguageVersion.CSharp10)] 12763[InlineData(LanguageVersion.CSharp11)] 12764public void UsingStmt_12(LanguageVersion langVersion) 12813[InlineData(LanguageVersion.CSharp10)] 12814[InlineData(LanguageVersion.CSharp11)] 12815public void UsingStmt_13(LanguageVersion langVersion) 12870[InlineData(LanguageVersion.CSharp10)] 12871[InlineData(LanguageVersion.CSharp11)] 12872public void UsingStmt_14(LanguageVersion langVersion) 12916[InlineData(LanguageVersion.CSharp10)] 12917[InlineData(LanguageVersion.CSharp11)] 12918public void UsingStmt_15(LanguageVersion langVersion) 12966[InlineData(LanguageVersion.CSharp10)] 12967[InlineData(LanguageVersion.CSharp11)] 12968public void UsingStmt_16(LanguageVersion langVersion) 13017[InlineData(LanguageVersion.CSharp10)] 13018[InlineData(LanguageVersion.CSharp11)] 13019public void UsingStmt_17(LanguageVersion langVersion) 13067[InlineData(LanguageVersion.CSharp10)] 13068[InlineData(LanguageVersion.CSharp11)] 13069public void UsingStmt_18(LanguageVersion langVersion) 13113[InlineData(LanguageVersion.CSharp10)] 13114[InlineData(LanguageVersion.CSharp11)] 13115public void UsingStmt_19(LanguageVersion langVersion) 13167[InlineData(LanguageVersion.CSharp10)] 13168[InlineData(LanguageVersion.CSharp11)] 13169public void UsingStmt_20(LanguageVersion langVersion) 13213[InlineData(LanguageVersion.CSharp10)] 13214[InlineData(LanguageVersion.CSharp11)] 13215public void UsingStmt_21(LanguageVersion langVersion) 13263[InlineData(LanguageVersion.CSharp10)] 13264[InlineData(LanguageVersion.CSharp11)] 13265public void UsingStmt_22(LanguageVersion langVersion) 13314[InlineData(LanguageVersion.CSharp10)] 13315[InlineData(LanguageVersion.CSharp11)] 13316public void UsingStmt_23(LanguageVersion langVersion) 13356[InlineData(LanguageVersion.CSharp10)] 13357[InlineData(LanguageVersion.CSharp11)] 13358public void UsingStmt_24(LanguageVersion langVersion) 13402[InlineData(LanguageVersion.CSharp10)] 13403[InlineData(LanguageVersion.CSharp11)] 13404public void UsingStmt_25(LanguageVersion langVersion) 13461[InlineData(LanguageVersion.CSharp10)] 13462[InlineData(LanguageVersion.CSharp11)] 13463public void UsingStmt_26(LanguageVersion langVersion) 13528[InlineData(LanguageVersion.CSharp10)] 13529[InlineData(LanguageVersion.CSharp11)] 13530public void Field_01(LanguageVersion langVersion) 13580[InlineData(LanguageVersion.CSharp10)] 13581[InlineData(LanguageVersion.CSharp11)] 13582public void Field_02(LanguageVersion langVersion) 13650[InlineData(LanguageVersion.CSharp10)] 13651[InlineData(LanguageVersion.CSharp11)] 13652public void Field_03(LanguageVersion langVersion) 13724[InlineData(LanguageVersion.CSharp10)] 13725[InlineData(LanguageVersion.CSharp11)] 13726public void Field_04(LanguageVersion langVersion) 13834[InlineData(LanguageVersion.CSharp10)] 13835[InlineData(LanguageVersion.CSharp11)] 13836public void Field_05(LanguageVersion langVersion) 13951[InlineData(LanguageVersion.CSharp10)] 13952[InlineData(LanguageVersion.CSharp11)] 13953public void Field_06(LanguageVersion langVersion) 14010[InlineData(LanguageVersion.CSharp10)] 14011[InlineData(LanguageVersion.CSharp11)] 14012public void Field_07(LanguageVersion langVersion) 14074[InlineData(LanguageVersion.CSharp10)] 14075[InlineData(LanguageVersion.CSharp11)] 14076public void Field_08(LanguageVersion langVersion) 14142[InlineData(LanguageVersion.CSharp10)] 14143[InlineData(LanguageVersion.CSharp11)] 14144public void Field_09(LanguageVersion langVersion) 14215[InlineData(LanguageVersion.CSharp8)] 14216[InlineData(LanguageVersion.CSharp10)] 14217[InlineData(LanguageVersion.CSharp11)] 14218public void Field_10(LanguageVersion langVersion) 14263[InlineData(LanguageVersion.CSharp10)] 14264[InlineData(LanguageVersion.CSharp11)] 14265public void Field_11(LanguageVersion langVersion) 14350[InlineData(LanguageVersion.CSharp10)] 14351[InlineData(LanguageVersion.CSharp11)] 14352public void Event_01(LanguageVersion langVersion) 14406[InlineData(LanguageVersion.CSharp10)] 14407[InlineData(LanguageVersion.CSharp11)] 14408public void Event_02(LanguageVersion langVersion) 14474[InlineData(LanguageVersion.CSharp10)] 14475[InlineData(LanguageVersion.CSharp11)] 14476public void Event_03(LanguageVersion 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 (123)
19private static bool IsParsedAsToken(LanguageVersion languageVersion, bool escapeIdentifier) 21return !escapeIdentifier && languageVersion > LanguageVersion.CSharp13; 24private void IdentifierNameOrFieldExpression(LanguageVersion languageVersion, bool escapeIdentifier) 29private void IdentifierNameOrFieldExpression(LanguageVersion languageVersion, bool escapeIdentifier, bool isParsedAsToken) 55[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 114[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 116bool expectedParsedAsToken = languageVersion > LanguageVersion.CSharp13; 156[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 158bool expectedParsedAsToken = languageVersion > LanguageVersion.CSharp13; 207[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 209bool expectedParsedAsToken = languageVersion > LanguageVersion.CSharp13; 263[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 266bool expectedParsedAsToken = languageVersion > LanguageVersion.CSharp13; 327[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 384[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 450[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 521[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 600[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 667[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 670bool expectedParsedAsToken = languageVersion > LanguageVersion.CSharp13; 748[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 844[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 894[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 951[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 997[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1043[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1089[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1139[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1193[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1239[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1308[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1359[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1413[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1475[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1553[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1616[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1692[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1743[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1833[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion, 1912[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 1963[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2022[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2081[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2145[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2218[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2269[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion) 2326[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersion.Preview)] LanguageVersion languageVersion)
Parsing\FileModifierParsingTests.cs (12)
1519[InlineData(LanguageVersion.CSharp10)] 1520[InlineData(LanguageVersion.CSharp11)] 1521public void TypeNamedFile_02(LanguageVersion languageVersion) 3138[InlineData(LanguageVersion.CSharp10)] 3139[InlineData(LanguageVersion.CSharp11)] 3140public void TopLevelVariable_01(LanguageVersion languageVersion) 3182[InlineData(LanguageVersion.CSharp10)] 3183[InlineData(LanguageVersion.CSharp11)] 3184public void TopLevelVariable_02(LanguageVersion languageVersion) 3222[InlineData(LanguageVersion.CSharp10)] 3223[InlineData(LanguageVersion.CSharp11)] 3224public void TopLevelVariable_03(LanguageVersion languageVersion)
Parsing\LambdaParameterParsingTests.cs (9)
5147[InlineData(LanguageVersion.CSharp9)] 5148[InlineData(LanguageVersion.CSharp11)] 5150public void KeywordParameterName_01(LanguageVersion languageVersion) 5177[InlineData(LanguageVersion.CSharp9)] 5178[InlineData(LanguageVersion.CSharp11)] 5180public void KeywordParameterName_02(LanguageVersion languageVersion) 5205[InlineData(LanguageVersion.CSharp9)] 5206[InlineData(LanguageVersion.CSharp11)] 5208public void KeywordParameterName_03(LanguageVersion languageVersion)
Parsing\LanguageVersionTests.cs (6)
18var highest = Enum. 19GetValues(typeof(LanguageVersion)). 20Cast<LanguageVersion>(). 21Where(x => x != LanguageVersion.Latest && x != LanguageVersion.Preview && x != LanguageVersion.LatestMajor).
Parsing\LocalFunctionParsingTests.cs (1)
1287var file = ParseFile(text, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6));
Parsing\MemberDeclarationParsingTests.cs (147)
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) } }; 2349foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 2491foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 2615foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 2721foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 2827foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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), 3230foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 3375foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 3503foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 3613foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 3723foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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), 4269foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 4403foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 4520foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 4619foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 4718foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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), 5109foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 5247foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 5368foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 5471foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 5574foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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), 6161foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6231foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6294foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6394foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6461foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6545foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 6645foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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), 7019foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 7132foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 7236foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 7340foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 7444foreach (var version in new[] { LanguageVersion.CSharp9, LanguageVersion.Preview }) 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 (6)
22UsingStatement(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8), expectedErrors); 50CreateCompilation(test, parseOptions: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)).VerifyDiagnostics( 6578foreach (var langVersion in new[] { LanguageVersion.CSharp6, LanguageVersion.CSharp7, LanguageVersion.CSharp8 })
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 (69)
19[InlineData(LanguageVersion.CSharp10)] 20[InlineData(LanguageVersion.CSharp11)] 21public void FieldDeclaration_01(LanguageVersion languageVersion) 56[InlineData(LanguageVersion.CSharp10)] 57[InlineData(LanguageVersion.CSharp11)] 58public void FieldDeclaration_02(LanguageVersion languageVersion) 94[InlineData(LanguageVersion.CSharp10)] 95[InlineData(LanguageVersion.CSharp11)] 96public void FieldDeclaration_03(LanguageVersion languageVersion) 130[InlineData(LanguageVersion.CSharp10)] 131[InlineData(LanguageVersion.CSharp11)] 132public void FieldDeclaration_04(LanguageVersion languageVersion) 167[InlineData(LanguageVersion.CSharp10)] 168[InlineData(LanguageVersion.CSharp11)] 169public void FieldDeclaration_Initializer_01(LanguageVersion languageVersion) 225[InlineData(LanguageVersion.CSharp10)] 226[InlineData(LanguageVersion.CSharp11)] 227public void FieldDeclaration_Initializer_02(LanguageVersion languageVersion) 287[InlineData(LanguageVersion.CSharp10)] 288[InlineData(LanguageVersion.CSharp11)] 289public void FieldDeclaration_Initializer_03(LanguageVersion languageVersion) 347[InlineData(LanguageVersion.CSharp10)] 348[InlineData(LanguageVersion.CSharp11)] 349public void FieldDeclaration_Initializer_04(LanguageVersion languageVersion) 400[InlineData(LanguageVersion.CSharp10)] 401[InlineData(LanguageVersion.CSharp11)] 402public void FieldDeclaration_Initializer_05(LanguageVersion languageVersion) 462[InlineData(LanguageVersion.CSharp10)] 463[InlineData(LanguageVersion.CSharp11)] 464public void Fixed_01(LanguageVersion languageVersion) 545[InlineData(LanguageVersion.CSharp10)] 546[InlineData(LanguageVersion.CSharp11)] 547public void Fixed_02(LanguageVersion languageVersion) 648[InlineData(LanguageVersion.CSharp10)] 649[InlineData(LanguageVersion.CSharp11)] 650public void ReadOnlyRefParameter(LanguageVersion languageVersion) 694[InlineData(LanguageVersion.CSharp10)] 695[InlineData(LanguageVersion.CSharp11)] 696public void ObjectInitializer(LanguageVersion languageVersion) 734[InlineData(LanguageVersion.CSharp10)] 735[InlineData(LanguageVersion.CSharp11)] 736public void ObjectInitializer_CompoundAssignment(LanguageVersion languageVersion) 778[InlineData(LanguageVersion.CSharp10)] 779[InlineData(LanguageVersion.CSharp11)] 780public void RefObjectInitializer_NestedInitializer(LanguageVersion languageVersion) 843[InlineData(LanguageVersion.CSharp10)] 844[InlineData(LanguageVersion.CSharp11)] 845public void RefCollectionInitializer(LanguageVersion languageVersion) 875[InlineData(LanguageVersion.CSharp10)] 876[InlineData(LanguageVersion.CSharp11)] 877public void RefDictionaryInitializer(LanguageVersion languageVersion) 926[InlineData(LanguageVersion.CSharp10)] 927[InlineData(LanguageVersion.CSharp11)] 928public void RefComplexElementInitializer(LanguageVersion languageVersion) 980[InlineData(LanguageVersion.CSharp10)] 981[InlineData(LanguageVersion.CSharp11)] 982public void AnonymousType_01(LanguageVersion languageVersion) 1011[InlineData(LanguageVersion.CSharp10)] 1012[InlineData(LanguageVersion.CSharp11)] 1013public void AnonymousType_02(LanguageVersion languageVersion) 1050[InlineData(LanguageVersion.CSharp10)] 1051[InlineData(LanguageVersion.CSharp11)] 1052public void AnonymousType_03(LanguageVersion languageVersion) 1089[InlineData(LanguageVersion.CSharp10)] 1090[InlineData(LanguageVersion.CSharp11)] 1091public void AnonymousType_04(LanguageVersion languageVersion) 1136[InlineData(LanguageVersion.CSharp10)] 1137[InlineData(LanguageVersion.CSharp11)] 1138public void AnonymousType_05(LanguageVersion languageVersion)
Parsing\RefReadonlyTests.cs (14)
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); 1317[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1381[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion languageVersion) 1413[CombinatorialValues(LanguageVersion.CSharp11, LanguageVersion.CSharp12, LanguageVersion.Preview)] LanguageVersion 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 (2)
23ParseAndRoundTripping(text, TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.Preview), errorCount, memberCount); 1579CSharpParseOptions options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp2);
Parsing\SeparatedSyntaxListParsingTests.cs (1)
735var tree = UsingTree(text, TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6),
Parsing\TopLevelStatementsParsingTests.cs (3)
1613[InlineData(LanguageVersion.CSharp9)] 1614[InlineData(LanguageVersion.Preview)] 1615public void TupleUnsupportedInUsingStatement(LanguageVersion version)
Syntax\FieldAndValueKeywordTests.cs (106)
22[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 41if (!escapeIdentifier && languageVersion > LanguageVersion.CSharp13) 92[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 114[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 133if (!escapeIdentifier && languageVersion > LanguageVersion.CSharp13) 152[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 177[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 205[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 223[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 241[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 254if (languageVersion > LanguageVersion.CSharp13) 270[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 282if (languageVersion > LanguageVersion.CSharp13) 298[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 315[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 326if (languageVersion > LanguageVersion.CSharp13) 342[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 353if (languageVersion > LanguageVersion.CSharp13) 369[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 380if (languageVersion > LanguageVersion.CSharp13) 396[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 407if (languageVersion > LanguageVersion.CSharp13) 423[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 434if (languageVersion > LanguageVersion.CSharp13) 450[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 467[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 484[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 501[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 518[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 534[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 556[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 574[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 591[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 602if (languageVersion > LanguageVersion.CSharp13) 618[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 643[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 662if (languageVersion > LanguageVersion.CSharp13) 684[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 701if (languageVersion > LanguageVersion.CSharp13) 717[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 739if (languageVersion > LanguageVersion.CSharp13) 755[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 775if (languageVersion > LanguageVersion.CSharp13) 791[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 811if (languageVersion > LanguageVersion.CSharp13) 827[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 847if (languageVersion > LanguageVersion.CSharp13) 909[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 927if (languageVersion > LanguageVersion.CSharp13) 943[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 961if (languageVersion > LanguageVersion.CSharp13) 977[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 999[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 1017if (languageVersion > LanguageVersion.CSharp13) 1036[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, bool escapeIdentifier) 1063if (!escapeIdentifier && languageVersion > LanguageVersion.CSharp13) 1088[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, bool escapeIdentifier) 1115else if (languageVersion > LanguageVersion.CSharp13) 1166[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 1176if (languageVersion > LanguageVersion.CSharp13) 1201[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion) 1219if (languageVersion > LanguageVersion.CSharp13) 1230verify(comp, synthesizeField: languageVersion > LanguageVersion.CSharp13); 1271verify(comp, synthesizeField: languageVersion > LanguageVersion.CSharp13); 1292[CombinatorialValues(LanguageVersion.CSharp13, LanguageVersionFacts.CSharpNext)] LanguageVersion languageVersion, 1312if (languageVersion > LanguageVersion.CSharp13)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (21)
TestOptions.cs (21)
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); 58new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None, languageVersion: LanguageVersion.Preview).WithFeatures(s_experimentalFeatures);
Microsoft.CodeAnalysis.CSharp.Workspaces (53)
Serialization\CSharpOptionsSerializationService.cs (2)
69var languageVersion = (LanguageVersion)reader.ReadInt32();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (6)
22LanguageVersion languageVersion, 116LanguageVersion languageVersion, 125languageVersion >= LanguageVersion.CSharp7 || 126(languageVersion >= LanguageVersion.CSharp6 && IsSupportedInCSharp6(declarationKind)); 181private static bool TryGetExpression(StatementSyntax firstStatement, LanguageVersion languageVersion, [NotNullWhen(true)] out ExpressionSyntax? expression, out SyntaxToken semicolonToken) 204if (languageVersion >= LanguageVersion.CSharp7 && throwStatement.Expression != null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this Compilation compilation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
25if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1 ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\LanguageVersionExtensions.cs (14)
9public static bool IsCSharp14OrAbove(this LanguageVersion languageVersion) 10=> languageVersion >= LanguageVersion.Preview; 12public static bool IsCSharp13OrAbove(this LanguageVersion languageVersion) 13=> languageVersion >= LanguageVersion.CSharp13; 15public static bool IsCSharp12OrAbove(this LanguageVersion languageVersion) 16=> languageVersion >= LanguageVersion.CSharp12; 18public static bool IsCSharp11OrAbove(this LanguageVersion languageVersion) 19=> languageVersion >= LanguageVersion.CSharp11; 21public static bool HasConstantInterpolatedStrings(this LanguageVersion languageVersion) 22=> languageVersion >= LanguageVersion.CSharp10; 24public static bool SupportsCollectionExpressions(this LanguageVersion languageVersion) 27public static bool SupportsPrimaryConstructors(this LanguageVersion languageVersion) 33internal const LanguageVersion CSharpNext = LanguageVersion.Preview;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParseOptionsExtensions.cs (1)
9public static LanguageVersion LanguageVersion(this ParseOptions options)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
508var languageVersion = semanticModel.SyntaxTree.Options.LanguageVersion(); 511return languageVersion >= LanguageVersion.CSharp11 && semanticModel.Compilation.SupportsRuntimeCapability(RuntimeCapability.NumericIntPtr);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
23public static LanguageVersion GetLanguageVersion(this SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (10)
49=> options.LanguageVersion() >= LanguageVersion.CSharp6; 52=> options.LanguageVersion() >= LanguageVersion.CSharp7; 55=> options.LanguageVersion() >= LanguageVersion.CSharp7; 58=> options.LanguageVersion() >= LanguageVersion.CSharp9; 61=> options.LanguageVersion() >= LanguageVersion.CSharp10; 64=> options.LanguageVersion() >= LanguageVersion.CSharp9; 67=> options.LanguageVersion() >= LanguageVersion.CSharp10; 70=> options.LanguageVersion() >= LanguageVersion.CSharp7; 77=> options.LanguageVersion() >= LanguageVersion.CSharp10; 1488=> options.LanguageVersion() >= LanguageVersion.CSharp9;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (1)
21if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1547if (originalSemanticModel.Compilation.LanguageVersion() < LanguageVersion.CSharp9 &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
839=> originalExpression.GetLanguageVersion() >= LanguageVersion.CSharp9;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
318if (!conversion.Exists && expression is LambdaExpressionSyntax && semanticModel.Compilation.LanguageVersion() >= LanguageVersion.CSharp10)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationContextInfo.cs (2)
12public readonly LanguageVersion LanguageVersion; 14public CSharpCodeGenerationContextInfo(CodeGenerationContext context, CSharpCodeGenerationOptions options, CSharpCodeGenerationService service, LanguageVersion languageVersion)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (1)
110info.LanguageVersion >= LanguageVersion.CSharp10)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (2)
177BasePropertyDeclarationSyntax baseProperty, LanguageVersion languageVersion, ExpressionBodyPreference preference, CancellationToken cancellationToken, 252SyntaxKind declarationKind, AccessorDeclarationSyntax accessor, LanguageVersion languageVersion, ExpressionBodyPreference preference, CancellationToken cancellationToken,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (2)
46if (semanticModel.Compilation.LanguageVersion().MapSpecifiedToEffectiveVersion() >= LanguageVersion.CSharp8) 68var isLanguageVersionGreaterOrEqualToCSharp8 = (semanticModel.Compilation as CSharpCompilation)?.LanguageVersion >= LanguageVersion.CSharp8;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
195=> ((CSharpParseOptions)options).LanguageVersion >= LanguageVersion.CSharp7;
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (3)
21private static readonly CSharpParseOptions _parseOptionWithLatestLanguageVersion = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview); 38!LanguageVersionFacts.TryParse(langVersionString, out var langVersion)) 40langVersion = LanguageVersion.Default;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4000.AddSyntaxTrees(ParseSyntaxTree(src, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities2 (2)
Intellisense\TestStateFactory.vb (2)
15Optional languageVersion As LanguageVersion = LanguageVersion.Default,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (89)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (83)
54showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 82showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 96<Project Language="C#" CommonReferences="true" LanguageVersion=<%= LanguageVersion.CSharp12.ToDisplayString() %>> 130<Project Language="C#" CommonReferences="true" LanguageVersion=<%= LanguageVersion.CSharp12.ToDisplayString() %>> 178showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 210showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 283showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 319showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 353showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 380showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 419showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 448showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 489showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 530showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 569showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 591showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 625showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 668showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 696showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 724showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 758showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp9) 781showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 2438}]]></Document>, languageVersion:=LanguageVersion.CSharp9, showCompletionInArgumentLists:=showCompletionInArgumentLists) 2461}]]></Document>, languageVersion:=LanguageVersion.CSharp9, showCompletionInArgumentLists:=showCompletionInArgumentLists) 2734</Document>, languageVersion:=LanguageVersion.CSharp7, showCompletionInArgumentLists:=showCompletionInArgumentLists) 3442languageVersion:=LanguageVersion.CSharp7, showCompletionInArgumentLists:=showCompletionInArgumentLists) 9744showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9792showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9829showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9860showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9889showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9908showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9927showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9948showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9969showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 9989showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10009showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10029showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10049showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10070showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10090showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10110showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10130showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10150showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10171showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10194showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10217showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 10240showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11275showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11301showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11332showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11364showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11396showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11428showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11460showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11492showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11524showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 11553languageVersion:=LanguageVersion.CSharp12) 11583languageVersion:=LanguageVersion.CSharp12) 11600<Project Language="C#" AssemblyName="TestAssembly" CommonReferencesPortable="true" LanguageVersion=<%= LanguageVersion.CSharp12.ToDisplayString() %>> 11638languageVersion:=LanguageVersion.CSharp12) 11660languageVersion:=LanguageVersion.CSharp12) 11682languageVersion:=LanguageVersion.CSharp12) 11708languageVersion:=LanguageVersion.CSharp12) 11731languageVersion:=LanguageVersion.CSharp12) 11748languageVersion:=LanguageVersion.CSharp12) 11770languageVersion:=LanguageVersion.CSharp12) 11792languageVersion:=LanguageVersion.CSharp12) 11818languageVersion:=LanguageVersion.CSharp12) 11841languageVersion:=LanguageVersion.CSharp12) 11866languageVersion:=LanguageVersion.CSharp12) 11896languageVersion:=LanguageVersion.CSharp12) 11926languageVersion:=LanguageVersion.CSharp12) 11976languageVersion:=LanguageVersion.CSharp12) 11996languageVersion:=LanguageVersion.CSharp12) 12013languageVersion:=LanguageVersion.CSharp11) 12591showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12615showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12632showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12678showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12703showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12727showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12) 12750showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12)
IntelliSense\CSharpCompletionCommandHandlerTests_DeclarationName.vb (1)
43showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.CSharp12)
Simplification\CastSimplificationTests.vb (5)
515Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)) 546Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10)) 1345Public Async Function TestCSharp_CastInTernaryExpression(languageVersion As LanguageVersion, expectedFalseExpression As String) As Task 1387Public Async Function TestCSharp_CastInTernaryExpression2(languageVersion As LanguageVersion, expectedTrueExpression As String) As Task 1429Public Async Function TestCSharp_CastInTernaryExpression3(languageVersion As LanguageVersion, expectedTrueExpression As String) As Task
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
2095solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10)); 3127solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10));
Microsoft.CodeAnalysis.Rebuild (1)
CSharpCompilationFactory.cs (1)
71CS.LanguageVersionFacts.TryParse(langVersionString, out var langVersion);
Microsoft.CodeAnalysis.Rebuild.UnitTests (3)
CSharpDeterministicKeyBuilderTests.cs (3)
324public void CSharpParseOptionsLanguageVersion(LanguageVersion languageVersion) 328var effective = languageVersion.MapSpecifiedToEffectiveVersion(); 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.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests_ObsoleteAttribute.vb (1)
2707Dim csCompilation = CreateCSharpCompilation("Dll1", csSource.Value, parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp7_2))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (10)
Compilation\SemanticModelAPITests.vb (1)
2964", parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp7_3))
Semantics\NativeIntegerTests.vb (1)
21Dim comp As Compilation = CreateCSharpCompilation(source0, parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp9))
Semantics\OverloadResolutionPriorityTests.vb (8)
105" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 1011" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 1762" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2015" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2066" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2114" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2149" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2189" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference()
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
VisualStudioMSBuildWorkspaceTests.cs (4)
1609await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp1, options => options.LanguageVersion); 1616await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp2, options => options.LanguageVersion); 1623await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp3, options => options.LanguageVersion); 1630await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp7_3.MapSpecifiedToEffectiveVersion(), options => options.LanguageVersion);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
311if (CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(languageVersionAttribute.Value, out var languageVersion))
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
BatchFixAllProviderTests.cs (1)
156return new CSharpParseOptions(LanguageVersion.Default, DocumentationMode.Diagnose);
SolutionTests\SolutionTests.cs (4)
1176parseOptions: new CSharpParseOptions(CS.LanguageVersion.CSharp5), 1350parseOptions: new CSharpParseOptions(CS.LanguageVersion.CSharp5), 1766var options = new CSharpParseOptions(CS.LanguageVersion.CSharp1); 1796document = document.Project.WithParseOptions(new CSharpParseOptions(languageVersion: CS.LanguageVersion.CSharp1)).GetRequiredDocument(documentId);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
387pws.SetParseOptions(projid, parseOptions.WithLanguageVersion(CS.LanguageVersion.CSharp3));
Microsoft.DotNet.GenFacades (5)
NotSupportedAssemblyGenerator.cs (2)
73LanguageVersion languageVersion = LanguageVersion.Default;
TypeParser.cs (3)
20LanguageVersion languageVersion = LanguageVersion.Default; 133private static IEnumerable<SyntaxTree> GetSourceTrees(IEnumerable<string> sourceFiles, IEnumerable<string> constants, LanguageVersion languageVersion)
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (3)
594if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) 597Diag(DiagnosticDescriptors.LoggingUnsupportedLanguageVersion, null, version.ToDisplayString(), LanguageVersion.CSharp8.ToDisplayString());
Microsoft.Extensions.Options.SourceGeneration (4)
OptionsSourceGenContext.cs (1)
18IsLangVersion11AndAbove = ((CSharpCompilation)compilation).LanguageVersion >= Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp11;
Parser.cs (3)
151if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) 154Diag(DiagDescriptors.OptionsUnsupportedLanguageVersion, null, version.ToDisplayString(), LanguageVersion.CSharp8.ToDisplayString());
Microsoft.Gen.ComplianceReports.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
56LanguageVersion langVersion = LanguageVersion.Preview) 307LanguageVersion langVersion = LanguageVersion.Preview,
Microsoft.Gen.ContextualOptions.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
56LanguageVersion langVersion = LanguageVersion.Preview) 307LanguageVersion langVersion = LanguageVersion.Preview,
Microsoft.Gen.Logging.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
56LanguageVersion langVersion = LanguageVersion.Preview) 307LanguageVersion langVersion = LanguageVersion.Preview,
Microsoft.Gen.Metrics.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
56LanguageVersion langVersion = LanguageVersion.Preview) 307LanguageVersion langVersion = LanguageVersion.Preview,
Microsoft.Gen.MetricsReports.Unit.Tests (4)
test\Generators\Shared\RoslynTestUtils.cs (4)
56LanguageVersion langVersion = LanguageVersion.Preview) 307LanguageVersion langVersion = LanguageVersion.Preview,
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
631if (((CSharpParseOptions)syntaxTree.Options).LanguageVersion < LanguageVersion.CSharp12)
Microsoft.ML.CodeAnalyzer.Tests (5)
Code\BestFriendTest.cs (2)
57LanguageVersion = LanguageVersion.CSharp7_2, 69projectA = projectA.WithParseOptions(((CSharpParseOptions)projectA.ParseOptions).WithLanguageVersion(LanguageVersion.CSharp7_2));
Code\ContractsCheckTest.cs (2)
48LanguageVersion = LanguageVersion.CSharp7_2, 102LanguageVersion = LanguageVersion.CSharp7_2,
Helpers\CSharpCodeFixVerifier`2.cs (1)
80public LanguageVersion? LanguageVersion { get; set; }
Microsoft.VisualStudio.LanguageServices.CSharp (5)
ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs (1)
21private static readonly CSharpParseOptions s_langVersionLatestParseOptions = new(LanguageVersion.Preview);
LanguageService\CSharpEditorFactory.cs (1)
36LanguageVersionFacts.TryParse(langVersionString, out var langVersion))
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
227LanguageVersionFacts.TryParse(GetStringOption(CompilerOptions.OPTID_COMPATIBILITY, defaultValue: ""), out var languageVersion);
Utilities\CSharpParseOptionsChangingService.cs (2)
40else if (newCSharpOptions.LanguageVersion == LanguageVersion.Preview) 51Contract.ThrowIfFalse(LanguageVersionFacts.TryParse(maxLangVersion, out var parsedMaxLanguageVersion));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (23)
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (11)
44[InlineData(LanguageVersion.CSharp7_3)] 45[InlineData(LanguageVersion.CSharp8)] 46[InlineData(LanguageVersion.CSharp9)] 47[InlineData(LanguageVersion.Latest)] 48[InlineData(LanguageVersion.LatestMajor)] 49[InlineData(LanguageVersion.Preview)] 51public async Task SetProperty_MaxSupportedLangVersion_CPS(LanguageVersion? maxSupportedLangVersion) 53const LanguageVersion attemptedVersion = LanguageVersion.CSharp8; 80const LanguageVersion attemptedVersion = LanguageVersion.CSharp8;
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (12)
66Assert.Equal(LanguageVersion.CSharp6, options.LanguageVersion); 169[InlineData(LanguageVersion.CSharp7_3)] 170[InlineData(LanguageVersion.CSharp8)] 171[InlineData(LanguageVersion.CSharp9)] 172[InlineData(LanguageVersion.Latest)] 173[InlineData(LanguageVersion.LatestMajor)] 174[InlineData(LanguageVersion.Preview)] 176public void SetProperty_MaxSupportedLangVersion(LanguageVersion? maxSupportedLangVersion) 193const LanguageVersion attemptedVersion = LanguageVersion.CSharp8; 224const LanguageVersion attemptedVersion = LanguageVersion.CSharp8;
System.Text.Json.SourceGeneration (4)
Helpers\RoslynExtensions.cs (1)
18public static LanguageVersion? GetLanguageVersion(this Compilation compilation)
JsonSourceGenerator.Parser.cs (3)
21private const LanguageVersion MinimumSupportedLanguageVersion = LanguageVersion.CSharp9; 118LanguageVersion? langVersion = _knownSymbols.Compilation.GetLanguageVersion();
System.Text.RegularExpressions.Generator (7)
RegexGenerator.cs (3)
39internal record struct CompilationData(bool AllowUnsafe, bool CheckOverflow, LanguageVersion LanguageVersion); 296private static bool SupportsCodeGeneration(RegexMethod method, LanguageVersion languageVersion, [NotNullWhen(false)] out string? reason) 298if (languageVersion < LanguageVersion.CSharp11)
RegexGenerator.Emitter.cs (2)
91IndentedTextWriter writer, RegexMethod rm, string reason, LanguageVersion langVer) 94if (langVer >= LanguageVersion.CSharp11)
RegexGenerator.Parser.cs (1)
210var compilationData = compilation is CSharpCompilation { LanguageVersion: LanguageVersion langVersion, Options: CSharpCompilationOptions compilationOptions }
UpgradeToGeneratedRegexAnalyzer.cs (1)
245if (((CSharpCompilation)compilation).LanguageVersion <= (LanguageVersion)1000)
System.Windows.Forms.Analyzers.CSharp.Tests (1)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (1)
39return parseOptions.WithLanguageVersion(LanguageVersion.Preview);