1 write to LanguageVersion
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpCompilation.cs (1)
486this.LanguageVersion = CommonLanguageVersion(syntaxAndDeclarations.ExternalSyntaxTrees);
69 references to LanguageVersion
Microsoft.CodeAnalysis.CSharp (45)
Binder\Binder_Deconstruct.cs (1)
580bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames();
Binder\Binder_Expressions.cs (7)
974bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 1062bool disallowInferredNames = this.Compilation.LanguageVersion.DisallowInferredTupleElementNames(); 1445diagnostics.Add(ErrorCode.WRN_FieldIsAmbiguous, node, Compilation.LanguageVersion.ToDisplayString()); 3334if (!hadLangVersionError && !Compilation.LanguageVersion.AllowNonTrailingNamedArguments()) 4529if (requiredVersion > Compilation.LanguageVersion) 7876Compilation.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion()) 10618if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
Binder\Binder_InterpolatedString.cs (1)
85this.Compilation.LanguageVersion.ToDisplayString(),
Binder\Binder_Invocation.cs (1)
503if (!Compilation.LanguageVersion.AllowNonTrailingNamedArguments())
Binder\Binder_Patterns.cs (5)
632if (Compilation.LanguageVersion < requiredVersion && !patternExpressionConversion.IsImplicit) 774if (requiredVersion > Compilation.LanguageVersion) 778Compilation.LanguageVersion.ToDisplayString(), 1246if (Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()) 1324|| (inputType.IsPointerType() && Compilation.LanguageVersion < MessageID.IDS_FeatureRecursivePatterns.RequiredVersion()))
Binder\Binder_Statements.cs (1)
396if (Compilation.LanguageVersion < MessageID.IDS_FeatureSwitchExpression.RequiredVersion())
Binder\Binder_Symbols.cs (3)
550diagnostics.Add(new LazyUseSiteDiagnosticsInfoForNullableType(Compilation.LanguageVersion, constructedType), syntax.GetLocation()); 559else if (GetNullableUnconstrainedTypeParameterDiagnosticIfNecessary(Compilation.LanguageVersion, constructedType) is { } diagnosticInfo) 931if (Compilation.LanguageVersion < MessageID.IDS_FeatureDynamic.RequiredVersion())
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
447if (Compilation.LanguageVersion.AllowImprovedOverloadCandidates()) 1304(binder.Compilation.LanguageVersion > LanguageVersion.CSharp12 || member.ContainingModule == binder.Compilation.SourceModule))) 3017if (Compilation.LanguageVersion < LanguageVersion.CSharp13)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1273binder.Compilation.LanguageVersion.ToDisplayString(),
Compilation\CSharpCompilation.cs (7)
227internal bool IsPeVerifyCompatEnabled => LanguageVersion < LanguageVersion.CSharp7_2 || Feature("peverify-compat") != null; 2057else if (LanguageVersion >= MessageID.IDS_FeatureAsyncMain.RequiredVersion() && taskEntryPoints.Count > 0) 2991if (Options.NullableContextOptions != NullableContextOptions.Disable && LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion() && 2995nameof(Options.NullableContextOptions), Options.NullableContextOptions, LanguageVersion.ToDisplayString(), 4768Debug.Assert(LanguageVersion == LanguageVersion.MapSpecifiedToEffectiveVersion()); 4769writeValue(CompilationOptionNames.LanguageVersion, LanguageVersion.ToDisplayString());
Compilation\CSharpCompilationExtensions.cs (1)
14return compilation.LanguageVersion >= feature.RequiredVersion();
Compiler\MethodCompiler.cs (2)
617_compilation.LanguageVersion >= MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion() && 1809var isSufficientLangVersion = compilation.LanguageVersion >= MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion();
Errors\MessageID.cs (1)
451=> compilation.IsFeatureEnabled(feature) ? null : GetDisabledFeatureDiagnosticInfo(feature, compilation.LanguageVersion);
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
96if (compilation.LanguageVersion >= MessageID.IDS_FeatureRecursivePatterns.RequiredVersion())
FlowAnalysis\NullableWalker.cs (2)
1686return compilation.LanguageVersion >= MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion(); 2426return requiredVersion <= compilation.LanguageVersion;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
580if (_factory.Compilation.LanguageVersion >= MessageID.IDS_FeatureCacheStaticMethodGroupConversion.RequiredVersion()
Symbols\Source\SourceMemberContainerSymbol.cs (1)
512if (name == SyntaxFacts.GetText(contextualKind) && compilation.LanguageVersion >= featureId.RequiredVersion())
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1201DeclaringCompilation.LanguageVersion >= MessageID.IDS_FeatureCovariantReturnsForOverrides.RequiredVersion())
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (1)
166var languageVersion = this.DeclaringCompilation.LanguageVersion;
Symbols\TypeSymbol.cs (3)
1016LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion; 1640LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion; 1741LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion;
Symbols\VarianceSafety.cs (1)
176return MessageID.IDS_FeatureVarianceSafetyForStaticInterfaceMembers.RequiredVersion() <= member.DeclaringCompilation.LanguageVersion;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
37if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
64if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
10=> ((CSharpCompilation)compilation).LanguageVersion;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
68var isLanguageVersionGreaterOrEqualToCSharp8 = (semanticModel.Compilation as CSharpCompilation)?.LanguageVersion >= LanguageVersion.CSharp8;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (10)
Emit\EditAndContinue\EditAndContinueDelegateCacheTests.cs (10)
48Assert.Equal(compilation0.LanguageVersion, compilation1.LanguageVersion); 112Assert.Equal(compilation0.LanguageVersion, compilation1.LanguageVersion); 176Assert.Equal(compilation0.LanguageVersion, compilation1.LanguageVersion); 240Assert.Equal(compilation0.LanguageVersion, compilation1.LanguageVersion); 304Assert.Equal(compilation0.LanguageVersion, compilation1.LanguageVersion);
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
37if (compilation.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
64if (compilation.LanguageVersion < LanguageVersion.CSharp8)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationExtensions.cs (1)
10=> ((CSharpCompilation)compilation).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSemanticFactsService.cs (1)
68var isLanguageVersionGreaterOrEqualToCSharp8 = (semanticModel.Compilation as CSharpCompilation)?.LanguageVersion >= LanguageVersion.CSharp8;
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
594if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 })
Microsoft.Extensions.Options.SourceGeneration (2)
OptionsSourceGenContext.cs (1)
18IsLangVersion11AndAbove = ((CSharpCompilation)compilation).LanguageVersion >= Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp11;
Parser.cs (1)
151if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 })
System.Text.Json.SourceGeneration (1)
Helpers\RoslynExtensions.cs (1)
19=> compilation is CSharpCompilation csc ? csc.LanguageVersion : null;
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Parser.cs (1)
210var compilationData = compilation is CSharpCompilation { LanguageVersion: LanguageVersion langVersion, Options: CSharpCompilationOptions compilationOptions }
UpgradeToGeneratedRegexAnalyzer.cs (1)
245if (((CSharpCompilation)compilation).LanguageVersion <= (LanguageVersion)1000)