-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add LangVersion 7.2 for C# #19846
Add LangVersion 7.2 for C# #19846
Conversation
microbuild_prtest failed with a connection failure (details). I will retest.
|
retest microbuild_prtest please |
@@ -120,6 +126,8 @@ internal static ErrorCode GetErrorCode(this LanguageVersion version) | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7; | |||
case LanguageVersion.CSharp7_1: | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7_1; | |||
case LanguageVersion.CSharp7_2: | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7_2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERR_FeatureNotAvailableInVersion7_2 [](start = 37, length = 35)
What is the benefit of having an error code per version? It looks like we could easily use one parameterized error message. In fact, for some features in some situations we do this (use parameterized error message) when these errors cannot be used. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd raised that question before. Someone (maybe Vlad or Neal) had previously suggested this helps telemetry.
Filed follow-up issue #19871
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dug up the telemetry comment (from Cyrus): #17435 (comment)
@CyrusNajmabadi Could you expand on why separate error codes and diagnostics is preferable for LanguageVersion, rather than one parameterized set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My telemetry comment was about you instantiating SolutionChangeAction directly. You need to create a subclass of that.
I do not care if you use a single diagnostic ID or different diagnostic IDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification.
I have a follow-up issue to use a generic diagnostic ID.
@AlekseyTs Any other feedback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @gafter was the person who pointed out the telemetry issue to me. He can confirm if that is still an issue or not.
Done with review pass. #Closed |
Conflicts: src/Compilers/CSharp/Portable/CSharpResources.resx src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
Rebased to resolve conflicts. |
@@ -120,6 +126,8 @@ internal static ErrorCode GetErrorCode(this LanguageVersion version) | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7; | |||
case LanguageVersion.CSharp7_1: | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7_1; | |||
case LanguageVersion.CSharp7_2: | |||
return ErrorCode.ERR_FeatureNotAvailableInVersion7_2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @gafter was the person who pointed out the telemetry issue to me. He can confirm if that is still an issue or not.
@@ -1488,5 +1488,9 @@ internal enum ErrorCode | |||
ERR_PatternWrongGenericTypeInVersion = 8314, | |||
|
|||
#endregion diagnostics introduced for C# 7.1 | |||
|
|||
#region diagnostics introduced for C# 7.2 | |||
ERR_FeatureNotAvailableInVersion7_2 = 8320, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is going into master, and there are no concers of conflicts, we can just use 8315?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going into 15.6 branch. 7.1 is not closed yet, so I left some buffer. (Just today I had to use a new error code for a 7.1 fix).
@@ -2705,7 +2705,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep | |||
<value>This warning occurs if the assembly attributes AssemblyKeyFileAttribute or AssemblyKeyNameAttribute found in source conflict with the /keyfile or /keycontainer command line option or key file name or key container specified in the Project Properties.</value> | |||
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to do a string search/replace over the modified error strings in the tests project, to make sure that the error comments in tests are updated as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resource strings I modified do not exist in tests. But I do have a test to extract the versions that appear on that line and verifies that it's complete: https://github.com/dotnet/roslyn/pull/19113/files#diff-492ea20f4ae7785ece041adfb13b4e7d
Approved, suggesting that this is accompanied by the project system PR as well. |
Thanks for the reminder. I'm starting on the project-system change. |
Here's the project system change to add the drop-down entry in Settings page: dotnet/project-system#2334 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
VS integration tests failed on @dotnet/roslyn-infrastructure FYI. I'll re-run this leg. |
@dotnet-bot retest windows_release_vs-integration_prtest please |
@dotnet/roslyn-compiler for review (15.6).