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

Contracts for System.Reflection.CustomAttributeExtensions #180

Merged
merged 2 commits into from
Jul 31, 2015
Merged

Contracts for System.Reflection.CustomAttributeExtensions #180

merged 2 commits into from
Jul 31, 2015

Conversation

fedotovalex
Copy link
Contributor

This adds contracts for the System.Reflection.CustomAttributeExtensions class, which is new in .NET framework 4.5.

public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo element, bool inherit) where T : Attribute
{
Contract.Requires(element != null);
Contract.Ensures(Contract.Result<IEnumerable<Attribute>>() != null);
Copy link
Member

Choose a reason for hiding this comment

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

❓ Any reason not to make this use IEnumerable<T> instead of IEnumerable<Attribute>? My guess is the current form was easier for copy/paste. I'm assuming the static checker doesn't have a problem with variance like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a copy/paste typo, thanks for catching it! Fixed now.

@sharwell
Copy link
Member

I had one question in the diff but overall 👍

@sharwell
Copy link
Member

:shipit:

SergeyTeplyakov added a commit that referenced this pull request Jul 31, 2015
Contracts for System.Reflection.CustomAttributeExtensions
@SergeyTeplyakov SergeyTeplyakov merged commit 46b21d8 into microsoft:master Jul 31, 2015
@SergeyTeplyakov
Copy link
Contributor

Merged.

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