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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ private static bool IsValidConstraint(

if (constraintTypes.Count > 0)
{
// "The class type constraint '{0}' must come before any other constraints"
// "The type constraint '{0}' must come before any other constraints"
Error(diagnostics, ErrorCode.ERR_ClassBoundNotFirst, syntax, type.Type);
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

</data>
<data name="ERR_BadVisBaseInterface" xml:space="preserve">
<value>Inconsistent accessibility: base interface '{1}' is less accessible than interface '{0}'</value>
Expand Down Expand Up @@ -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.

</data>
<data name="ERR_PartialWrongTypeParams" xml:space="preserve">
<value>Partial declarations of '{0}' must have the same type parameter names in the same order</value>
Expand Down Expand Up @@ -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.

<value>The type constraint '{0}' must come before any other constraints</value>
</data>
<data name="ERR_BadRetType" xml:space="preserve">
<value>'{1} {0}' has the wrong return type</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ private Tuple<NamedTypeSymbol, ImmutableArray<NamedTypeSymbol>> MakeDeclaredBase

if (!this.IsNoMoreVisibleThan(baseType, ref useSiteInfo))
{
// Inconsistent accessibility: base class '{1}' is less accessible than class '{0}'
// Inconsistent accessibility: base type '{1}' is less accessible than type '{0}'
diagnostics.Add(ErrorCode.ERR_BadVisBaseClass, baseTypeLocation, this, baseType);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading