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

Conversation

@justinvp
Copy link
Contributor

Mostly automated replacement of parameter name string literals with corresponding usage of nameof (via a modified version of @jaredpar's https://github.com/jaredpar/UseNameOf) along the lines of #6209 and #6265.

cc: @stephentoub, @dsplaisted

{
Requires.NotNull(parameter, "reflectedType");
Requires.NotNull(parameter, "parameter");
Requires.NotNull(reflectedType, nameof(reflectedType));
Copy link
Member

Choose a reason for hiding this comment

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

While I'm sure this is what was originally intended, are we going to start failing in places we didn't previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I'm going to just remove the reflectedType null check here as later uses of reflectedType guard against it being null (but don't throw) and it never threw for null before (which would be a breaking change as you point out).

@stephentoub
Copy link
Member

One concern, otherwise LGTM.

Mostly automated replacement of parameter name string literals with
corresponding usage of nameof.
@stephentoub
Copy link
Member

LGTM

stephentoub added a commit that referenced this pull request Feb 20, 2016
Use nameof in System.Composition.*
@stephentoub stephentoub merged commit 4c2f79e into dotnet:master Feb 20, 2016
@justinvp justinvp deleted the nameof_composition branch February 20, 2016 17:37
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Use nameof in System.Composition.*

Commit migrated from dotnet/corefx@4c2f79e
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.

4 participants