Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main to main-vs-deps #54394

Merged
merged 30 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dd64c2a
Handle CData and avoid normalizing code
Youssef1313 May 4, 2021
718b0fc
Test CDATA for metadata-as-source
Youssef1313 May 4, 2021
c3ce061
Fix test
Youssef1313 May 4, 2021
e5c261a
Fix test
Youssef1313 May 4, 2021
c0e6992
Add comment
Youssef1313 May 4, 2021
0cc823b
Address feedback
Youssef1313 May 4, 2021
c3a86c8
Fix
Youssef1313 May 4, 2021
e01d57a
Fix code normalization
Youssef1313 May 10, 2021
69ad011
Address feedback
Youssef1313 May 12, 2021
b6159fc
Address feedback
Youssef1313 May 12, 2021
636bc29
Fix
Youssef1313 May 12, 2021
57278e7
dotnet-format -w Roslyn.sln
ryzngard Jun 17, 2021
40c25c2
Add ignore-revs file for formatting change
ryzngard Jun 17, 2021
f4363b7
Update dotnet-format version
ryzngard Jun 18, 2021
fbdb560
Revert "dotnet-format -w Roslyn.sln"
ryzngard Jun 18, 2021
abce41d
dotnet-format -w Roslyn.sln
ryzngard Jun 18, 2021
dc88b22
update ignore-revs file to latest change
ryzngard Jun 18, 2021
49aff93
HasChangesAsync may be called outside of the debugging session
tmat Jun 22, 2021
519bf81
[main] Update dependencies from dotnet/source-build (#54243)
dotnet-maestro[bot] Jun 24, 2021
33e3895
Merge pull request #54291 from tmat/FixNREInEnc
sharwell Jun 24, 2021
9193177
Bugfix: GetAwaitExpressionInfo ignores BoundConversion (#54296)
bernd5 Jun 24, 2021
c177fa8
Merge pull request #53140 from Youssef1313/quick-info-cdata
sharwell Jun 24, 2021
9e30164
Add LanguageVersion 10 (#54359)
jcouv Jun 24, 2021
e1042fd
Avoid thread dependency in VirtualMemoryNotificationListener constructor
sharwell Jun 24, 2021
c1ec4b3
Merge pull request #54378 from sharwell/memory-listener
sharwell Jun 25, 2021
0130339
Calculate TypeParameterKind based on the container type (#54200)
MykolaBalakin Jun 25, 2021
a89d4dd
Merge remote-tracking branch 'dotnet/release/dev16.11' into merges/re…
sharwell Jun 25, 2021
2941ae1
Report all-empty top level statements. (#54385)
AlekseyTs Jun 25, 2021
87675a2
Merge pull request #54368 from dotnet/merges/release/dev16.11-to-main
Jun 25, 2021
55a5f3a
Merge pull request #54195 from ryzngard/formatting/yeet
ryzngard Jun 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Dotnet-format -w Roslyn.sln
abce41d282ac631be5217140f1bd46d0e250ad02
19 changes: 12 additions & 7 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ efforts behind them.

| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
| [Record structs](https://github.com/dotnet/csharplang/issues/4334) | [record-structs](https://github.com/dotnet/roslyn/tree/features/record-structs) | [Merged into 16.11](https://github.com/dotnet/roslyn/issues/51199) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [Global Using Directive](https://github.com/dotnet/csharplang/issues/3428) | [GlobalUsingDirective](https://github.com/dotnet/roslyn/tree/features/GlobalUsingDirective) | [Merged into 16.11](https://github.com/dotnet/roslyn/issues/51307) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | [AlekseyTs](https://github.com/AlekseyTs) |
| [Static Abstract Members In Interfaces](https://github.com/dotnet/csharplang/issues/4436) | [StaticAbstractMembersInInterfaces](https://github.com/dotnet/roslyn/tree/features/StaticAbstractMembersInInterfaces) | [In Progress](https://github.com/dotnet/roslyn/issues/52221) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [RikkiGibson](https://github.com/RikkiGibson) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [File-scoped namespace](https://github.com/dotnet/csharplang/issues/137) | [FileScopedNamespaces](https://github.com/dotnet/roslyn/tree/features/FileScopedNamespaces) | [In Progress](https://github.com/dotnet/roslyn/issues/49000) | [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv), [chsienki](https://github.com/chsienki) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Interpolated string improvements](https://github.com/dotnet/csharplang/issues/4487) | [interpolated-string](https://github.com/dotnet/roslyn/tree/features/interpolated-string) | [In Progress](https://github.com/dotnet/roslyn/issues/51499) | [333fred](https://github.com/333fred) | [AlekseyTs](https://github.com/AlekseyTs), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Parameterless struct constructors](https://github.com/dotnet/csharplang/issues/99) | [struct-ctors](https://github.com/dotnet/roslyn/tree/features/struct-ctors) | [In Progress](https://github.com/dotnet/roslyn/issues/51698) | [cston](https://github.com/cston) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [jcouv](https://github.com/jouv) |
| [Lambda improvements](https://github.com/dotnet/csharplang/blob/main/proposals/lambda-improvements.md) | [lambdas](https://github.com/dotnet/roslyn/tree/features/lambdas) | [In Progress](https://github.com/dotnet/roslyn/issues/52192) | [cston](https://github.com/cston) | [333fred](https://github.com/333fred), [jcouv](https://github.com/jcouv) | [jaredpar](https://github.com/jaredpar) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [In Progress](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [Improved Definite Assignment](https://github.com/dotnet/csharplang/issues/4465) | [improved-definite-assignment](https://github.com/dotnet/roslyn/tree/features/improved-definite-assignment) | [Merged into 17.0](https://github.com/dotnet/roslyn/issues/51463) | [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) | [jaredpar](https://github.com/jaredpar) |
| [Relax ordering of `ref` and `partial` modifiers](https://github.com/dotnet/csharplang/issues/946) | [ref-partial](https://github.com/dotnet/roslyn/tree/features/ref-partial) | In Progress | [alrz](https://github.com/alrz) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [In Progress](https://github.com/dotnet/roslyn/issues/36024) | [fayrose](https://github.com/fayrose) | [agocke](https://github.com/agocke) | [jaredpar](https://github.com/jaredpar) |
| [Caller expression attribute](https://github.com/dotnet/csharplang/issues/287) | [caller-argument-expression](https://github.com/dotnet/roslyn/tree/features/caller-argument-expression) | [In Progress](https://github.com/dotnet/roslyn/issues/52745) | [Youssef1313](https://github.com/Youssef1313) | [333fred](https://github.com/333fred),[AlekseyTs](https://github.com/AlekseyTs) | [jcouv](https://github.com/jcouv) |
| [Generic attributes](https://github.com/dotnet/csharplang/issues/124) | [generic-attributes](https://github.com/dotnet/roslyn/tree/features/generic-attributes) | [In Progress](https://github.com/dotnet/roslyn/issues/36285) | [AviAvni](https://github.com/AviAvni) | [agocke](https://github.com/agocke) | [mattwar](https://github.com/mattwar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [Implemented](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Constant Interpolated Strings](https://github.com/dotnet/csharplang/issues/2951) | main | [Merged into 16.9p3](https://github.com/dotnet/roslyn/pull/49676) | [kevinsun-dev](https://github.com/kevinsun-dev) | [333fred](https://github.com/333fred) | [jaredar](https://github.com/jaredpar), [agocke](https://github.com/agocke) |
| [Mix declarations and variables in deconstruction](https://github.com/dotnet/csharplang/issues/125) | main | [Merged into 16.10](https://github.com/dotnet/roslyn/issues/47746) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [In Progress](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |

# C# 10.0

| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
| [Record structs](https://github.com/dotnet/csharplang/issues/4334) | [record-structs](https://github.com/dotnet/roslyn/tree/features/record-structs) | [Merged into 16.11](https://github.com/dotnet/roslyn/issues/51199) | [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) |
| [Global Using Directive](https://github.com/dotnet/csharplang/issues/3428) | [GlobalUsingDirective](https://github.com/dotnet/roslyn/tree/features/GlobalUsingDirective) | [Merged into 16.11](https://github.com/dotnet/roslyn/issues/51307) | [AlekseyTs](https://github.com/AlekseyTs) | [333fred](https://github.com/333fred), [cston](https://github.com/cston) | [AlekseyTs](https://github.com/AlekseyTs) |
| [Improved Definite Assignment](https://github.com/dotnet/csharplang/issues/4465) | [improved-definite-assignment](https://github.com/dotnet/roslyn/tree/features/improved-definite-assignment) | [Merged into 17.0](https://github.com/dotnet/roslyn/issues/51463) | [RikkiGibson](https://github.com/RikkiGibson) | [jcouv](https://github.com/jcouv) | [jaredpar](https://github.com/jaredpar) |
| [Constant Interpolated Strings](https://github.com/dotnet/csharplang/issues/2951) | main | [Merged into 16.9p3](https://github.com/dotnet/roslyn/pull/49676) | [kevinsun-dev](https://github.com/kevinsun-dev) | [333fred](https://github.com/333fred) | [jaredar](https://github.com/jaredpar), [agocke](https://github.com/agocke) |
| [Extended property patterns](https://github.com/dotnet/csharplang/issues/4394) | [extended-property-patterns](https://github.com/dotnet/roslyn/tree/features/extended-property-patterns) | [Merged into 17.0](https://github.com/dotnet/roslyn/issues/52468) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Sealed record ToString](https://github.com/dotnet/csharplang/issues/4174) | main | [Merged](https://github.com/dotnet/roslyn/issues/52031) | [thomaslevesque](https://github.com/thomaslevesque/) | [jcouv](https://github.com/jcouv) | [333fred](https://github.com/333fred) |
| [Source Generator V2 APIs](https://github.com/dotnet/roslyn/issues/51257) | [features/source-generators](https://github.com/dotnet/roslyn/tree/features/source-generators) | [In Progress](https://github.com/dotnet/roslyn/issues/51257) | [chsienki](https://github.com/chsienki/) | [rikkigibson](https://github.com/rikkigibson), [jaredpar](https://github.com/jaredpar), [cston](https://github.com/cston) | N/A |
| [Async method builder override](https://github.com/dotnet/csharplang/issues/1407) | main | [In Progress](https://github.com/dotnet/roslyn/issues/51999) | [jcouv](https://github.com/jcouv) | TBD | [stephentoub](https://github.com/stephentoub) |
| [Source Generator V2 APIs](https://github.com/dotnet/roslyn/issues/51257) | [features/source-generators](https://github.com/dotnet/roslyn/tree/features/source-generators) | [Merged into 17.0p2](https://github.com/dotnet/roslyn/issues/51257) | [chsienki](https://github.com/chsienki/) | [rikkigibson](https://github.com/rikkigibson), [jaredpar](https://github.com/jaredpar), [cston](https://github.com/cston) | N/A |
| [Mix declarations and variables in deconstruction](https://github.com/dotnet/csharplang/issues/125) | main | [Merged into 16.10](https://github.com/dotnet/roslyn/issues/47746) | [YairHalberstadt ](https://github.com/YairHalberstadt) | [jcouv](https://github.com/jcouv) | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Async method builder override](https://github.com/dotnet/csharplang/issues/1407) | main | [Merged into 17.0p2](https://github.com/dotnet/roslyn/issues/51999) | [jcouv](https://github.com/jcouv) | [cston](https://github.com/cston), [RikkiGibson](https://github.com/RikkiGibson) | [stephentoub](https://github.com/stephentoub) |

# VB 16.9

Expand Down
2 changes: 1 addition & 1 deletion dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"isRoot": true,
"tools": {
"dotnet-format": {
"version": "5.0.141503",
"version": "6.0.231801",
"commands": [
"dotnet-format"
]
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<Sha>7e80445ee82adbf9a8e6ae601ac5e239d982afaa</Sha>
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build" Version="0.1.0-alpha.1.21318.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build" Version="0.1.0-alpha.1.21323.2">
<Uri>https://github.com/dotnet/source-build</Uri>
<Sha>3fb25b8db3bec654e37e71a5b2b7fde14444bc2f</Sha>
<Sha>c35d744cbe24f85d2165a5edb1730355b8cb916f</Sha>
<SourceBuild RepoName="source-build" ManagedOnly="true" />
</Dependency>
</ProductDependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Binder/MethodArgumentInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down
6 changes: 6 additions & 0 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -6418,6 +6418,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_FeatureNotAvailableInVersion9" xml:space="preserve">
<value>Feature '{0}' is not available in C# 9.0. Please use language version {1} or greater.</value>
</data>
<data name="ERR_FeatureNotAvailableInVersion10" xml:space="preserve">
<value>Feature '{0}' is not available in C# 10.0. Please use language version {1} or greater.</value>
</data>
<data name="ERR_UnexpectedArgumentList" xml:space="preserve">
<value>Unexpected argument list.</value>
</data>
Expand Down Expand Up @@ -6719,4 +6722,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_BuilderAttributeDisallowed" xml:space="preserve">
<value>The AsyncMethodBuilder attribute is disallowed on anonymous methods without an explicit return type.</value>
</data>
<data name="ERR_SimpleProgramIsEmpty" xml:space="preserve">
<value>At least one top-level statement must be non-empty.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ public override AwaitExpressionInfo GetAwaitExpressionInfo(AwaitExpressionSyntax
throw new ArgumentException("node.Kind==" + node.Kind());
}

var bound = GetUpperBoundNode(node);
var bound = GetLowerBoundNode(node);
BoundAwaitableInfo awaitableInfo = (((bound as BoundExpressionStatement)?.Expression ?? bound) as BoundAwaitExpression)?.AwaitableInfo;
if (awaitableInfo == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private ImmutableArray<SingleNamespaceOrTypeDeclaration> VisitNamespaceChildren(
bool isIterator = false;
bool hasReturnWithExpression = false;
GlobalStatementSyntax firstGlobalStatement = null;
bool hasNonEmptyGlobalSatement = false;

var childrenBuilder = ArrayBuilder<SingleNamespaceOrTypeDeclaration>.GetInstance();
foreach (var member in members)
Expand All @@ -74,6 +75,11 @@ private ImmutableArray<SingleNamespaceOrTypeDeclaration> VisitNamespaceChildren(
firstGlobalStatement ??= global;
var topLevelStatement = global.Statement;

if (!topLevelStatement.IsKind(SyntaxKind.EmptyStatement))
{
hasNonEmptyGlobalSatement = true;
}

if (!hasAwaitExpressions)
{
hasAwaitExpressions = SyntaxFacts.HasAwaitOperations(topLevelStatement);
Expand All @@ -98,7 +104,16 @@ private ImmutableArray<SingleNamespaceOrTypeDeclaration> VisitNamespaceChildren(
// wrap all global statements in a compilation unit into a simple program type:
if (firstGlobalStatement is object)
{
childrenBuilder.Add(CreateSimpleProgram(firstGlobalStatement, hasAwaitExpressions, isIterator, hasReturnWithExpression));
var diagnostics = ImmutableArray<Diagnostic>.Empty;

if (!hasNonEmptyGlobalSatement)
{
var bag = DiagnosticBag.GetInstance();
bag.Add(ErrorCode.ERR_SimpleProgramIsEmpty, ((EmptyStatementSyntax)firstGlobalStatement.Statement).SemicolonToken.GetLocation());
diagnostics = bag.ToReadOnlyAndFree();
}

childrenBuilder.Add(CreateSimpleProgram(firstGlobalStatement, hasAwaitExpressions, isIterator, hasReturnWithExpression, diagnostics));
}

// wrap all members that are defined in a namespace or compilation unit into an implicit type:
Expand Down Expand Up @@ -130,7 +145,7 @@ private static SingleNamespaceOrTypeDeclaration CreateImplicitClass(ImmutableSeg
diagnostics: ImmutableArray<Diagnostic>.Empty);
}

private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatementSyntax firstGlobalStatement, bool hasAwaitExpressions, bool isIterator, bool hasReturnWithExpression)
private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatementSyntax firstGlobalStatement, bool hasAwaitExpressions, bool isIterator, bool hasReturnWithExpression, ImmutableArray<Diagnostic> diagnostics)
{
return new SingleTypeDeclaration(
kind: DeclarationKind.SimpleProgram,
Expand All @@ -144,7 +159,7 @@ private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatem
nameLocation: new SourceLocation(firstGlobalStatement.GetFirstToken()),
memberNames: ImmutableSegmentedDictionary<string, VoidResult>.Empty,
children: ImmutableArray<SingleTypeDeclaration>.Empty,
diagnostics: ImmutableArray<Diagnostic>.Empty);
diagnostics: diagnostics);
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,8 @@ internal enum ErrorCode
HDN_DuplicateWithGlobalUsing = 8933,
ERR_CantConvAnonMethReturnType = 8934,
ERR_BuilderAttributeDisallowed = 8935,
ERR_FeatureNotAvailableInVersion10 = 8936,
ERR_SimpleProgramIsEmpty = 8937,

#endregion

Expand Down
13 changes: 7 additions & 6 deletions src/Compilers/CSharp/Portable/Errors/MessageID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
switch (feature)
{
// C# preview features.
case MessageID.IDS_FeatureStaticAbstractMembersInInterfaces: // semantic check
return LanguageVersion.Preview;

// C# 10.0 features.
case MessageID.IDS_FeatureMixedDeclarationsAndExpressionsInDeconstruction: // semantic check
case MessageID.IDS_FeatureSealedToStringInRecord: // semantic check
case MessageID.IDS_FeatureRecordStructs:
Expand All @@ -345,10 +349,10 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
case MessageID.IDS_FeatureInferredDelegateType: // semantic check
case MessageID.IDS_FeatureLambdaAttributes: // semantic check
case MessageID.IDS_FeatureExtendedPropertyPatterns:
case MessageID.IDS_FeatureStaticAbstractMembersInInterfaces: // semantic check
case MessageID.IDS_FeatureLambdaReturnType: // semantic check
case MessageID.IDS_AsyncMethodBuilderOverride: // semantic check
return LanguageVersion.Preview;
case MessageID.IDS_FeatureConstantInterpolatedStrings: // semantic check
return LanguageVersion.CSharp10;

// C# 9.0 features.
case MessageID.IDS_FeatureLambdaDiscardParameters: // semantic check
Expand All @@ -375,12 +379,9 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
case MessageID.IDS_FeatureStaticAnonymousFunction: // syntax check
case MessageID.IDS_FeatureModuleInitializers: // semantic check on method attribute
case MessageID.IDS_FeatureDefaultTypeParameterConstraint:
case MessageID.IDS_FeatureVarianceSafetyForStaticInterfaceMembers: // semantic check
return LanguageVersion.CSharp9;

case MessageID.IDS_FeatureVarianceSafetyForStaticInterfaceMembers: //semantic check
case MessageID.IDS_FeatureConstantInterpolatedStrings: //semantic check
return LanguageVersion.Preview;

// C# 8.0 features.
case MessageID.IDS_FeatureAltInterpolatedVerbatimStrings:
case MessageID.IDS_FeatureCoalesceAssignmentExpression:
Expand Down
Loading