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