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

Improve few diagnostics #52047

Closed
wants to merge 2 commits into from
Closed

Conversation

Youssef1313
Copy link
Member

I did part of the changes I suggested in #48286. The others in the issue aren't really important I think. But let me know if you think otherwise.

Fixes #48286

@Youssef1313 Youssef1313 requested a review from a team as a code owner March 22, 2021 14:06
@Youssef1313
Copy link
Member Author

Closing and re-opening for a new build. (D:\workspace\_work\1\s\artifacts\toolset\restore.proj : error : Failed to retrieve information about 'Microsoft.DotNet.Arcade.Sdk' from remote source 'https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/58ca65bb-e6c1-4210-88ac-fa55c1cd7877/nuget/v3/flat2/microsoft.dotnet.arcade.sdk/index.json'.)

@Youssef1313 Youssef1313 deleted the diag-improvements branch March 22, 2021 14:51
@Youssef1313 Youssef1313 restored the diag-improvements branch March 22, 2021 14:51
@Youssef1313 Youssef1313 reopened this Mar 22, 2021
@jcouv jcouv added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Mar 22, 2021
@jcouv jcouv self-assigned this Mar 22, 2021
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 Thanks (iteration 1)

@333fred
Copy link
Member

333fred commented Mar 22, 2021

Would you mind going through the test cases that use these diagnostics and updating the messages?

@Youssef1313
Copy link
Member Author

Would you mind going through the test cases that use these diagnostics and updating the messages?

Sure. Let me know if you want to update the enum member names as well.

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 Thanks (iteration 2)

@jcouv jcouv requested a review from 333fred March 23, 2021 17:00
@@ -547,7 +547,7 @@
<value>Inconsistent accessibility: parameter type '{1}' is less accessible than delegate '{0}'</value>
</data>
<data name="ERR_BadVisBaseClass" xml:space="preserve">
<value>Inconsistent accessibility: base class '{1}' is less accessible than class '{0}'</value>
<value>Inconsistent accessibility: base type '{1}' is less accessible than type '{0}'</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

type [](start = 44, length = 4)

I do not think we should make this change. A record class is a class.

@@ -1138,7 +1138,7 @@
<value>Partial declarations of '{0}' have conflicting accessibility modifiers</value>
</data>
<data name="ERR_PartialMultipleBases" xml:space="preserve">
<value>Partial declarations of '{0}' must not specify different base classes</value>
<value>Partial declarations of '{0}' must not specify different base types</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

types [](start = 73, length = 5)

I do not think we should make this change. A record class is a class and this error isn't about an interface in the base list, but specifically about the class type.

@@ -1276,7 +1276,7 @@
<value>Duplicate constraint '{0}' for type parameter '{1}'</value>
</data>
<data name="ERR_ClassBoundNotFirst" xml:space="preserve">
<value>The class type constraint '{0}' must come before any other constraints</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

class [](start = 15, length = 6)

I do not think we should make his change. This error is specifically about class types (record classes are classes), not about interface types, for example.

AlekseyTs
AlekseyTs previously approved these changes Mar 23, 2021
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

I do not think the proposed changes are actually an improvement. In my opinion the existing wording is precise and correct.

@AlekseyTs AlekseyTs dismissed their stale review March 23, 2021 17:29

Approved by mistake

@Youssef1313
Copy link
Member Author

Youssef1313 commented Mar 23, 2021

@AlekseyTs This makes diagnostics consistent with the changes already done in #46341.

As a specific example (there are many):

- Circular base class dependency involving '{0}' and '{1}'
+ Circular base type dependency involving '{0}' and '{1}'

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

I do not think the proposed changes are actually an improvement. In my opinion the existing wording is precise and correct.

@AlekseyTs
Copy link
Contributor

This makes diagnostics consistent with the changes already done in #46341

Didn't go through the changes in it, so it is quite possible that some or even all changes there make sense, or made sense at the time. I don't think there is a goal to get to "consistency" where every mention of a "class" is replaced with "type". Especially that now we have record classes and record structures, I don't believe there is a good reason to avoid referring to record classes as classes in cases when "record-ness" of the type isn't really important, by comparison to other aspects of the type.

@Youssef1313
Copy link
Member Author

Got your point. But this probably means some of the changes in #46341 shouldn't have been made?

@Youssef1313 Youssef1313 deleted the diag-improvements branch March 23, 2021 18:27
@AlekseyTs
Copy link
Contributor

Got your point. But this probably means some of the changes in #46341 shouldn't have been made?

Quite possible, however, it looks like some of the messages modified in this PR were looked at in context of that PR. They were not touched at the end. There are commits referring to ERR_BadVisBaseClass and ERR_ClassBoundNotFirst, and ERR_PartialMultipleBases was left unchanged based on my feedback (#46341 (comment)).

@Youssef1313
Copy link
Member Author

Thanks for the additional info @AlekseyTs! That makes much sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostic improvements for records
4 participants