Skip to content

Code cleanup: take advantage of C# 8 features. - #370

Merged
simeoncran merged 4 commits into
masterfrom
CleanupOfWarningsAndSuggestions
Oct 20, 2020
Merged

simeoncran merged 4 commits into
masterfrom
CleanupOfWarningsAndSuggestions

Conversation

@simeoncran

Copy link
Copy Markdown
Contributor

Also adds some more #nullable enable annotation so quieten code analysis.

None of these changes should have changed any behaviors.

Also adds some more #nullable enable annotation so quieten code analysis.

None of these changes should have changed any behaviors.
@simeoncran
simeoncran requested a review from a team as a code owner October 17, 2020 00:01
@derobinsMSFT

derobinsMSFT commented Oct 17, 2020 •

Copy link
Copy Markdown

// Licensed to the .NET Foundation under one or more agreements.

If all of these error suppressions are gone, is this file needed anymore? Or does Code Analysis always expect to find this file even if it's "empty"? #Closed


Refers to: GlobalSuppressions.cs:1 in 1c4bdab. [](commit_id = 1c4bdab, deletion_comment = False)

@@ -192,14 +192,10 @@ bool TryInlineObject(YamlObject obj, int maximumWidth, [MaybeNullWhen(false)] ou
{
switch (obj.Kind)

@derobinsMSFT derobinsMSFT Oct 20, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

switch (obj.Kind) [](start = 16, length = 17)

return (obj.Kind) switch? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried, and failed. I think it's hitting a limitation of the nullable analysis. Even though the TryInline methods all return a string with MaybeNullWhen(false), the nullable analysis complains if this is a switch expression.


In reply to: 508131986 [](ancestors = 508131986)

@derobinsMSFT derobinsMSFT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

@simeoncran
simeoncran merged commit b624e55 into master Oct 20, 2020
@delete-merged-branch
delete-merged-branch Bot deleted the CleanupOfWarningsAndSuggestions branch October 20, 2020 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants