未验证 提交 d1d5595a 编写于 作者: D dotnet-automerge-bot 提交者: GitHub

Merge pull request #34703 from dotnet/merges/master-to-features/readonly-members

Merge master to features/readonly-members
......@@ -10,7 +10,7 @@ efforts behind them.
| Feature | Branch | State | Developers | Reviewer | LDM Champ |
| ------- | ------ | ----- | ---------- | -------- | --------- |
| [Default Interface Methods](https://github.com/dotnet/csharplang/blob/master/proposals/default-interface-methods.md) | [defaultInterfaceImplementation](https://github.com/dotnet/roslyn/tree/features/DefaultInterfaceImplementation) | [Prototype](https://github.com/dotnet/roslyn/issues/19217) | [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) | [gafter](https://github.com/gafter) |
| [Default Interface Methods](https://github.com/dotnet/csharplang/blob/master/proposals/default-interface-methods.md) | [defaultInterfaceImplementation](https://github.com/dotnet/roslyn/tree/features/DefaultInterfaceImplementation) | [Merged to dev16.1 preview2](https://github.com/dotnet/roslyn/issues/19217) | [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) | [gafter](https://github.com/gafter) |
| [Nullable reference type](https://github.com/dotnet/csharplang/blob/master/proposals/nullable-reference-types.md) | [NullableReferenceTypes](https://github.com/dotnet/roslyn/tree/features/NullableReferenceTypes) | [Merged to dev16.0 preview1](https://github.com/dotnet/roslyn/issues/22152) | [cston](https://github.com/cston), [jcouv](https://github.com/jcouv) | [AlekseyTs](https://github.com/AlekseyTs), [333fred](https://github.com/333fred) | [mattwar](https://github.com/mattwar) |
| [Recursive patterns](https://github.com/dotnet/csharplang/blob/master/proposals/patterns.md) | [recursive-patterns](https://github.com/dotnet/roslyn/tree/features/recursive-patterns) | [Merged to dev16.0 preview2](https://github.com/dotnet/roslyn/issues/25935) | [gafter](https://github.com/gafter) | [agocke](https://github.com/agocke), [cston](https://github.com/cston) | [gafter](https://github.com/gafter) |
| [Async streams](https://github.com/dotnet/csharplang/blob/master/proposals/async-streams.md) | [async-streams](https://github.com/dotnet/roslyn/tree/features/async-streams) | [Merged to dev16.0 preview1](https://github.com/dotnet/roslyn/issues/24037) | [jcouv](https://github.com/jcouv) | [agocke](https://github.com/agocke) | [stephentoub](https://github.com/stephentoub) |
......@@ -26,14 +26,14 @@ efforts behind them.
| [stackalloc in nested contexts](https://github.com/dotnet/csharplang/issues/1412) | [nested-stackalloc](https://github.com/dotnet/roslyn/tree/features/nested-stackalloc) | [In Progress](https://github.com/dotnet/roslyn/issues/28968) | [gafter](https://github.com/gafter) | - | [gafter](https://github.com/gafter)
| [Unmanaged generic structs](https://github.com/dotnet/csharplang/issues/1744) | master | [Merged to dev16.1 preview1](https://github.com/dotnet/roslyn/issues/31374) | [RikkiGibson](https://github.com/RikkiGibson) | - | [jaredpar](https://github.com/jaredpar) |
| [Static local functions](https://github.com/dotnet/csharplang/issues/1565) | master | [Merged in dev16.0 preview2](https://github.com/dotnet/roslyn/issues/32069) | [cston](https://github.com/cston) | [jaredpar](https://github.com/jaredpar) | [jcouv](https://github.com/jcouv)
| [Readonly members](https://github.com/dotnet/csharplang/issues/1710) | [readonly-members](https://github.com/dotnet/roslyn/tree/features/readonly-members) | [Prototype](https://github.com/dotnet/roslyn/issues/32911) | [RikkiGibson](https://github.com/RikkiGibson) | TBD | [jaredpar](https://github.com/jaredpar)
| [Readonly members](https://github.com/dotnet/csharplang/issues/1710) | [readonly-members](https://github.com/dotnet/roslyn/tree/features/readonly-members) | [Merged to dev16.1 preview2](https://github.com/dotnet/roslyn/issues/32911) | [RikkiGibson](https://github.com/RikkiGibson) | TBD | [jaredpar](https://github.com/jaredpar)
# VB 16.0
| Feature | Branch | State | Developers | Reviewer | LDM Champ |
| ------- | ------ | ----- | ---------- | -------- | --------- |
| [Line continuation comments](https://github.com/dotnet/vblang/issues/65) | [continuation-comments](https://github.com/dotnet/roslyn/tree/features/continuation-comments) | Prototype | [paul1956](https://github.com/paul1956) | [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) |
| [Relax null coalesing operator requirements](https://github.com/dotnet/vblang/issues/339) | [null-operator-enhancements](https://github.com/dotnet/roslyn/tree/features/null-operator-enhancements) | In Progress | [333fred](https://github.com/333fred) | [cston](https://github.com/cston) | [gafter](https://github.com/gafter) |
| [Line continuation comments](https://github.com/dotnet/vblang/issues/65) | [continuation-comments](https://github.com/dotnet/roslyn/tree/features/continuation-comments) | Merged in 16.1 (preview2) | [paul1956](https://github.com/paul1956) | [AlekseyTs](https://github.com/AlekseyTs) | [gafter](https://github.com/gafter) |
| [Relax null-coalescing operator requirements](https://github.com/dotnet/vblang/issues/339) | [null-operator-enhancements](https://github.com/dotnet/roslyn/tree/features/null-operator-enhancements) | Merged in 16.0 | [333fred](https://github.com/333fred) | [cston](https://github.com/cston) | [gafter](https://github.com/gafter) |
# C# 7.3
......
......@@ -388,7 +388,7 @@ class C
{
void M()
{
_ = this is { }
_ = this is {}
}
}";
......@@ -431,7 +431,7 @@ class C
{
void M()
{
_ = this is { }
_ = this is {}
M();
}
}";
......@@ -476,7 +476,7 @@ class C
{
void M()
{
_ = this is (1, 2) { }
_ = this is (1, 2) {}
M();
}
}";
......
......@@ -257,6 +257,14 @@ public override AdjustSpacesOperation GetAdjustSpacesOperation(SyntaxToken previ
return CreateAdjustSpacesOperation(0, AdjustSpacesOption.ForceSpacesIfOnSingleLine);
}
// empty {} in pattern
if (previousToken.Kind() == SyntaxKind.OpenBraceToken &&
currentToken.Kind() == SyntaxKind.CloseBraceToken &&
currentToken.Parent.IsKind(SyntaxKindEx.PropertyPatternClause))
{
return CreateAdjustSpacesOperation(0, AdjustSpacesOption.ForceSpacesIfOnSingleLine);
}
// attribute case
// , [
if (previousToken.Kind() == SyntaxKind.CommaToken && currentToken.Kind() == SyntaxKind.OpenBracketToken && currentToken.Parent is AttributeListSyntax)
......
......@@ -5142,7 +5142,7 @@ public async Task FormatRecursivePattern_NoSpaceBetweenTypeAndPositionalSubpatte
{
void M()
{
_ = this is C(1, 2) { };
_ = this is C(1, 2) {};
}
}";
// no space separates the type and the positional pattern
......@@ -5165,7 +5165,7 @@ public async Task FormatRecursivePattern_PreferSpaceBetweenTypeAndPositionalSubp
{
void M()
{
_ = this is C (1, 2) { };
_ = this is C (1, 2) {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
......@@ -5188,8 +5188,8 @@ public async Task FormatRecursivePattern_PreferSpaceInsidePositionalSubpatternPa
{
void M()
{
_ = this is C( 1, 2 ) { };
_ = this is C() { };
_ = this is C( 1, 2 ) {};
_ = this is C() {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
......@@ -5212,8 +5212,8 @@ public async Task FormatRecursivePattern_PreferSpaceInsideEmptyPositionalSubpatt
{
void M()
{
_ = this is C(1, 2) { };
_ = this is C( ) { };
_ = this is C(1, 2) {};
_ = this is C( ) {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
......@@ -5290,7 +5290,7 @@ public async Task FormatPropertyPattern_FollowedByInvocation()
{
void M()
{
_ = this is { }
_ = this is {}
M();
}
}";
......@@ -5313,7 +5313,7 @@ public async Task FormatPositionalPattern_FollowedByInvocation()
{
void M()
{
_ = this is (1, 2) { }
_ = this is (1, 2) {}
M();
}
}";
......@@ -9069,6 +9069,91 @@ public void Foo()
}");
}
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public async Task EmptyIsPropertyPattern()
{
var code = @"
class C
{
void M()
{
_ = x is { }
}
}
";
var expected = @"
class C
{
void M()
{
_ = x is {}
}
}
";
await AssertFormatAsync(expected, code);
}
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public async Task EmptySwitchCasePropertyPattern()
{
var code = @"
class C
{
void M()
{
switch (x)
{
case { }
}
}
}
";
var expected = @"
class C
{
void M()
{
switch (x)
{
case {}
}
}
}
";
await AssertFormatAsync(expected, code);
}
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public async Task EmptySwitchExpressionCasePropertyPattern()
{
var code = @"
class C
{
void M()
{
_ = x switch
{
{ } =>
}
}
";
var expected = @"
class C
{
void M()
{
_ = x switch
{
{} =>
}
}
";
await AssertFormatAsync(expected, code);
}
[Theory, Trait(Traits.Feature, Traits.Features.Formatting)]
[WorkItem(31571, "https://github.com/dotnet/roslyn/issues/31571")]
[WorkItem(33910, "https://github.com/dotnet/roslyn/issues/33910")]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册