Skip to content

Enable IDE0059 #39434

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

Merged
merged 1 commit into from
Jan 13, 2022
Merged

Enable IDE0059 #39434

merged 1 commit into from
Jan 13, 2022

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Jan 11, 2022

Contributes to #24055

@pranavkm pranavkm marked this pull request as ready for review January 11, 2022 17:18
@Pilchie Pilchie added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 11, 2022
if (traitAttribute is ReflectionAttributeInfo attribute && attribute.Attribute is QuarantinedTestAttribute quarantinedTestAttribute)
if (traitAttribute is ReflectionAttributeInfo { Attribute: QuarantinedTestAttribute })
Copy link
Contributor

Choose a reason for hiding this comment

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

++pranavPoints

var codeUnitCount = 1;
var expectValueMin = 0;
int currentDecodeBits;
int codeUnitCount;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be:

int codeUnitCount = 1;?

var byteCount = 1;
var expectValueMin = 0;
int currentDecodeBits;
int byteCount;
Copy link
Contributor

Choose a reason for hiding this comment

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

byteCount = 1?

Comment on lines -213 to -214
Contract.Ensures((Contract.ValueAtReturn(out length) >= 0) &&
(Contract.ValueAtReturn(out length) <= (input.Length - startIndex)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this no longer necessary here and below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK Code contracts don't work. They're left over from when this code was initially ported over. Right @Tratcher ?

@pranavkm pranavkm merged commit fd18915 into dotnet:main Jan 13, 2022
@pranavkm pranavkm deleted the IDE0059 branch January 13, 2022 18:49
@ghost ghost added this to the 7.0-preview1 milestone Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants