Skip to content

Commit

Permalink
Merge pull request #34703 from dotnet/merges/master-to-features/reado…
Browse files Browse the repository at this point in the history
…nly-members

Merge master to features/readonly-members
  • Loading branch information
dotnet-automerge-bot authored Apr 3, 2019
2 parents 48ad407 + f78e517 commit d1d5595
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 15 deletions.
8 changes: 4 additions & 4 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class C
{
void M()
{
_ = this is { }
_ = this is {}
}
}";

Expand Down Expand Up @@ -431,7 +431,7 @@ class C
{
void M()
{
_ = this is { }
_ = this is {}
M();
}
}";
Expand Down Expand Up @@ -476,7 +476,7 @@ class C
{
void M()
{
_ = this is (1, 2) { }
_ = this is (1, 2) {}
M();
}
}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
101 changes: 93 additions & 8 deletions src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5142,7 +5142,7 @@ void M() {
{
void M()
{
_ = this is C(1, 2) { };
_ = this is C(1, 2) {};
}
}";
// no space separates the type and the positional pattern
Expand All @@ -5165,7 +5165,7 @@ void M() {
{
void M()
{
_ = this is C (1, 2) { };
_ = this is C (1, 2) {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
Expand All @@ -5188,8 +5188,8 @@ void M() {
{
void M()
{
_ = this is C( 1, 2 ) { };
_ = this is C() { };
_ = this is C( 1, 2 ) {};
_ = this is C() {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
Expand All @@ -5212,8 +5212,8 @@ void M() {
{
void M()
{
_ = this is C(1, 2) { };
_ = this is C( ) { };
_ = this is C(1, 2) {};
_ = this is C( ) {};
}
}";
await AssertFormatAsync(expectedCode, code, changedOptionSet: changingOptions);
Expand Down Expand Up @@ -5290,7 +5290,7 @@ void M() {
{
void M()
{
_ = this is { }
_ = this is {}
M();
}
}";
Expand All @@ -5313,7 +5313,7 @@ void M() {
{
void M()
{
_ = this is (1, 2) { }
_ = this is (1, 2) {}
M();
}
}";
Expand Down Expand Up @@ -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")]
Expand Down

0 comments on commit d1d5595

Please sign in to comment.