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

Follow up on PR #17894 on 7.1 version parsing #17990

Merged
merged 3 commits into from
Mar 21, 2017
Merged

Follow up on PR #17894 on 7.1 version parsing #17990

merged 3 commits into from
Mar 21, 2017

Conversation

OmarTawfik
Copy link
Contributor

@OmarTawfik OmarTawfik commented Mar 20, 2017

Responds to feedback on #17894

cc @jcouv @dotnet/roslyn-compiler @dotnet/roslyn-compat-council

@OmarTawfik OmarTawfik added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Mar 20, 2017
@@ -1347,6 +1320,28 @@ public void LanguageVersion_DisplayString()
}

[Fact]
public void LanguageVersion_GetErrorCode()
Copy link
Member

@jcouv jcouv Mar 20, 2017

Choose a reason for hiding this comment

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

Thanks :-) #Resolved

[InlineData("6.0", LanguageVersion.CSharp6)]
[InlineData("7", LanguageVersion.CSharp7)]
[InlineData("7.0", LanguageVersion.CSharp7)]
[InlineData("7.1", LanguageVersion.CSharp7_1)]
Copy link
Member

@jcouv jcouv Mar 20, 2017

Choose a reason for hiding this comment

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

Nice. Do you plan do to similar refactoring on VB side? #Closed

Copy link
Contributor Author

@OmarTawfik OmarTawfik Mar 20, 2017

Choose a reason for hiding this comment

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

I'd rather keep this PR focused on the C# version side. Every now and then I find similar mega-tests and I break them down, so I prefer doing them as we go.
If you think there is a wider-spread and they should be dealt with sooner, I can file an issue and start looking into them. #Closed

Copy link
Member

@jcouv jcouv Mar 20, 2017

Choose a reason for hiding this comment

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

Sounds good. #Closed

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM with a question about VB.
Thanks!

@OmarTawfik OmarTawfik added Area-Compilers and removed PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels Mar 20, 2017
</data>
<data name="ERR_FeatureNotAvailableInVersion7" xml:space="preserve">
<value>Feature '{0}' is not available in C# 7. Please use language version {1} or greater.</value>
<value>Feature '{0}' is not available in C# 7. Please use language version {1} or greater.</value>
Copy link
Member

@jaredpar jaredpar Mar 20, 2017

Choose a reason for hiding this comment

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

Why did we remove all of the spaces here? Seems unrelated to this PR. #Resolved

Copy link
Member

@jcouv jcouv Mar 20, 2017

Choose a reason for hiding this comment

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

This is a follow-up on the last PR. ERR_FeatureNotAvailableInVersion7_1 was added and it had this extra space. Then Omar pointed out all the previous versions had the same typo. #Resolved

<value>Feature '{0}' is not available in C# 7.1. Please use language version {1} or greater.</value>
</data>
<data name="ERR_LanguageVersionCannotHaveLeadingZeroes" xml:space="preserve">
<value>Specified language version '{0}' cannot have leading zeroes</value>
Copy link
Member

@jaredpar jaredpar Mar 20, 2017

Choose a reason for hiding this comment

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

Did we discuss what happens with trailing 0s? Sorry if I missed that part of the email. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Per last email from @gafter, we are accepting this as a breaking change, and putting it in the Post VS2017 breaking change markdown (edited in this PR).


In reply to: 107026072 [](ancestors = 107026072)

Copy link
Member

@jaredpar jaredpar Mar 20, 2017

Choose a reason for hiding this comment

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

Yes but that covers only a single trailing 0. What happens when I enter "7.000"?

The code gives an error for leading zero but not a trailing zeros. Possibly a non-issue but want to make sure it was explicitly considered. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We never accepted them in the first place, so this shouldn't be a breaking change. Am I missing something?


In reply to: 107036325 [](ancestors = 107036325)

Copy link
Member

Choose a reason for hiding this comment

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

This isn't about a breaking change, it's about symmetry.

/langversion:07
Error: leading zeros not allowed 
/langversion:7.00
Invalid language version 

Seems like this could be a reasonable typo in the new point release world.

Not hard feedback. Just an item I want to make sure we've considered.

Copy link
Contributor Author

@OmarTawfik OmarTawfik Mar 20, 2017

Choose a reason for hiding this comment

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

We never accepted trailing zeroes, so that's not a breaking change. Am I missing something? #Resolved

Copy link
Contributor Author

@OmarTawfik OmarTawfik Mar 20, 2017

Choose a reason for hiding this comment

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

Good point. My personal opinion is that everything eventually should be disallowed with the latter error message. This exception was done for the breaking change. Will have to think about it.


In reply to: 107037475 [](ancestors = 107037475)

@@ -805,6 +805,12 @@ public new CSharpCommandLineArguments Parse(IEnumerable<string> args, string bas
{
AddDiagnostic(diagnostics, ErrorCode.ERR_SwitchNeedsString, MessageID.IDS_Text.Localize(), "/langversion:");
}
else if (value.StartsWith("0"))
Copy link
Member

@jaredpar jaredpar Mar 20, 2017

Choose a reason for hiding this comment

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

Please use an explicit comparer here. The default for StartsWith is to use culture sensitive comparisons and I'm unsure if that is correct here. Believe this should be ordinal. #Resolved

@OmarTawfik OmarTawfik merged commit a20a6cb into dotnet:master Mar 21, 2017
@OmarTawfik OmarTawfik deleted the pr-comments-on-7.1-version-parsing branch March 21, 2017 17:20
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.

4 participants