Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Conversation

@tom-englert
Copy link
Contributor

Fix a lot of buggy system contracts

Copy link
Contributor

Choose a reason for hiding this comment

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

❓ How does this help the contracts? (I never would have thought to include internal methods in the API contracts, but that doesn't mean they aren't useful.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not help the contracts, but to understand what's going on here any why the contract must be this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Thanks for clarifying. When I was reading through the code in the current form, I didn't feel like I understood exactly why Dispatcher could return null. If the comment for Dispatcher was updated in the way I mentioned in my other comment (on that property), I feel like this internal method and the preceding comment(s) could be removed from the code without reducing the clarity of this set of contracts, as freezing a Freezable is a well-understood concept for API consumers.

Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Should this check against 0 as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I've added this.

Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Is this missing contracts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll add them later.

Copy link
Contributor

Choose a reason for hiding this comment

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

❗ I'm fine with that as long as you create an issue. If the issue is narrow-scoped, it might make it easier for a new contributor to come along and add them. An example:

Add contracts for NotifyCollectionChangedEventArgs

A stub contract class for NotifyCollectionChangedEventArgs was added in #84. The contracts for methods in this class still need to be added.

Then we can mark the issue with the up for grabs label. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the issue.
However it would be much easier if the one that finds a bug directly creates the issue 😄

@sharwell
Copy link
Contributor

sharwell commented Jul 3, 2015

First of all, this pull request was a massive improvement over #21, in terms of ability to focus the review on changes to contracts. Great job with that, I know it must have been a lot of work. 👍

You've given me a lot to think about. I'll be filing some "interesting issues" (IMO) as a result. Also 👍 for this.

I'll read over the answers to the questions later today.

Copy link
Contributor

Choose a reason for hiding this comment

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

❗ This is incorrect. It should be index < Count instead of index <= Count (the documentation above it needs to be corrected as well.

📝 Yes, MSDN is incorrect on this.

@tom-englert
Copy link
Contributor Author

@SergeyTeplyakov any idea when you will merge this? @sharwell has reviewed it and I don't see any more concerns.

sharwell added a commit to sharwell/CodeContracts that referenced this pull request Jul 9, 2015
@sharwell sharwell mentioned this pull request Jul 9, 2015
@SergeyTeplyakov SergeyTeplyakov merged commit 400467b into microsoft:master Jul 9, 2015
@tom-englert tom-englert deleted the ContractFixes branch July 10, 2015 06:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants