DotNetAnalyzers / NullParameterCheckRefactoring

Null Parameter Check Refactoring for Reference Type Parameters
MIT License
14 stars 4 forks source link

Only use nameof for C# 6 or higher #9

Closed sharwell closed 9 years ago

sharwell commented 9 years ago

Fixes #1

The language version is exposed through the CSharpParseOptions.LanguageVersion property, which can be set in the project file using the <LangVersion> property.

Also fixes a misuse of ParseTypeName that should have been ParseExpression.

tugberkugurlu commented 9 years ago

Looking good. I wasn't able to test this. I tried on .NET 3.5 but I guess it also uses the new compiler. :shipit:

Do you want me to do the rebase?

sharwell commented 9 years ago

If the project file does not contain the <LangVersion> property, it always assumes 6 regardless of the target framework version. I tested it with two of my projects (one C# 4, one C# 6) and it worked perfectly. :+1:

This pull request is already based on master, so there is no need to rebase.

tugberkugurlu commented 9 years ago

I hate to do merges though as they create a seperate empty commit. I'll rebase this on top master now and get this in.

sharwell commented 9 years ago

The separate empty commit is what shows units of work. :+1: It's just one of the reasons why Git is better than Subversion.

tugberkugurlu commented 9 years ago

nah, it's just an implementation detail :smile: