Skip to content

Empty C# statement has no side-effects#26603

Merged
gafter merged 2 commits intodotnet:masterfrom
gafter:master-4729
May 4, 2018
Merged

Empty C# statement has no side-effects#26603
gafter merged 2 commits intodotnet:masterfrom
gafter:master-4729

Conversation

@gafter
Copy link
Copy Markdown
Member

@gafter gafter commented May 3, 2018

Fixes #4729

@dotnet/roslyn-compiler May I please have a couple of reviews of this one-line bug fix?

@gafter gafter self-assigned this May 3, 2018
@gafter gafter requested a review from a team as a code owner May 3, 2018 19:58
@gafter gafter added the 4 - In Review A fix for the issue is submitted for review. label May 3, 2018
@jcouv jcouv added this to the 15.8 milestone May 3, 2018
}");
}

[Fact]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 If you use a [Theory] here, you could actually write the test so the contents of each block is parameterized as a clean way to validate the code generated for "" and ";" is the same.

[Theory]
[InlineData("")]
[InlineData(";")]
public void NopInTryCatchFinally(string nopText)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, that's a great idea.

@gafter gafter merged commit 276fb8e into dotnet:master May 4, 2018
@gafter gafter removed 4 - In Review A fix for the issue is submitted for review. labels Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty statement ";" suppresses try-catch-finally optimization in some circumstances

5 participants