Skip to content
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

Allow a method's type parameter to be used in nameof() in parameter default value #552

Merged
merged 1 commit into from
Feb 17, 2015

Conversation

gafter
Copy link
Member

@gafter gafter commented Feb 16, 2015

Fixes #42

@gafter gafter self-assigned this Feb 16, 2015
@gafter gafter added this to the 1.0-rc2 milestone Feb 16, 2015
@gafter gafter added Area-Compilers 4 - In Review A fix for the issue is submitted for review. Bug Language-C# labels Feb 16, 2015
@gafter
Copy link
Member Author

gafter commented Feb 16, 2015

To: @AlekseyTs @agocke @VSadov @VladimirReshetnikov @jaredpar

Can a couple of you please take a look?

@jaredpar
Copy link
Member

👍

Can we get a negative test as well? Essentially binding nameof(R) where R is not a valid argument to nameof in this context?

string s = nameof(T) // ok
) { }
}";
var compilation = CreateCompilationWithMscorlib45(source).VerifyDiagnostics();
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the test really depend on mscorlib 4.5?

Copy link
Member Author

Choose a reason for hiding this comment

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

No.

@AlekseyTs
Copy link
Contributor

LGTM. Consider adding similar test for VB.

@agocke
Copy link
Member

agocke commented Feb 17, 2015

LGTM

gafter added a commit that referenced this pull request Feb 17, 2015
Allow a method's type parameter to be used in nameof() in parameter default value
@gafter gafter merged commit cf25075 into dotnet:master Feb 17, 2015
@gafter gafter deleted the fix42 branch February 17, 2015 01:24
@gafter gafter removed the 4 - In Review A fix for the issue is submitted for review. label Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method generic type parameters are out of parameter list scope for 'nameof' expression
5 participants