Skip to content

Commit 78c53ce

Browse files
authored
Add new C# 14 diagnostics for interface implementations, and consolidate existing interface implementation diagnostics (#49871)
* Create shell for interface issues Create shell, TOC, and placeholder for error consolidation related to interface implementations. * Add explicit interface diagnostics * expand scope to interface impl * Further consolidation * partial checkin * First pass on themes. * First edit pass * second edit pass. * final edit pass * review feedback. * build issue
1 parent c9f70d2 commit 78c53ce

25 files changed

+326
-1027
lines changed

.github/prompts/error-consolidation.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Overall steps:
1212

1313
We're going to work through a series of files consolidating errors and warnings.
1414

15-
- For the duration of this chat, all references to "destination file" refer to `attribute-usage-errors.md`.
16-
- For the duration of this chat, all references to "the target theme" refer to errors and warnings related to declaring and using *attributes*.
15+
- For the duration of this chat, all references to "destination file" refer to `explicit-interface-errors.md`.
16+
- For the duration of this chat, all references to "the target theme" refer to errors and warnings related to members that explicitly implement an interface member.
1717

1818
The destination file already contains a skeleton for the final output.
1919

@@ -66,3 +66,14 @@ Understand these instructions, then suggest a list of themes and the included er
6666

6767
Rework the highlighted section so the focus is on how to correct each error. This article doesn't need to explain the associated language feature. Instead, in each section, provide links to language reference or language specification material that explains the rules violated when these diagnostics appear. Add explanatory context after each correction (in parentheses with the error code). Provided brief reasons why each correction is needed. Use detailed, sentence-style explanations rather than brief imperative statements. For each recommendation put the affectived error codes in parentheses, and in **bold** style. Remove extensive examples.
6868

69+
## Verify error messages
70+
71+
For every line in this table, verify that the error message associated with this error code matches the verbatim text in CSharpResources.resx. You can find the mapping using ErrorCodes.cs:
72+
73+
1. Find that number as a constant in `ErrorCodes.cs`.
74+
2. Locate the corresponding `data` element in CSharpResources.resx. The `name` atttribute should match the number of the constant.
75+
3. Read the error message found in the `<value>` element that is a child of that `<data>` element.
76+
77+
<make your own hand edits>
78+
79+
Now, ensure every instance of an error message matches the text in the highlighted table.

.openpublishing.redirection.csharp.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,18 @@
315315
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0034.md",
316316
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
317317
},
318+
{
319+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0071.md",
320+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
321+
},
322+
{
323+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0106.md",
324+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
325+
},
326+
{
327+
"source_path_from_root": "/docs/csharp/misc/cs0277.md",
328+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
329+
},
318330
{
319331
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0178.md",
320332
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
@@ -355,6 +367,22 @@
355367
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0650.md",
356368
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/array-declaration-errors"
357369
},
370+
{
371+
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0686.md",
372+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
373+
},
374+
{
375+
"source_path_from_root": "/docs/csharp/misc/cs0736.md",
376+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
377+
},
378+
{
379+
"source_path_from_root": "/docs/csharp/misc/cs0737.md",
380+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
381+
},
382+
{
383+
"source_path_from_root": "/docs/csharp/misc/cs0738.md",
384+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
385+
},
358386
{
359387
"source_path_from_root": "/docs/csharp/language-reference/compiler-messages/cs0767.md",
360388
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors"
@@ -1833,10 +1861,34 @@
18331861
"source_path_from_root": "/docs/csharp/misc/cs0457.md",
18341862
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overload-resolution"
18351863
},
1864+
{
1865+
"source_path_from_root": "/docs/csharp/misc/cs0425.md",
1866+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1867+
},
1868+
{
1869+
"source_path_from_root": "/docs/csharp/misc/cs0460.md",
1870+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1871+
},
18361872
{
18371873
"source_path_from_root": "/docs/csharp/misc/cs0466.md",
18381874
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/params-arrays"
18391875
},
1876+
{
1877+
"source_path_from_root": "/docs/csharp/misc/cs0470.md",
1878+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1879+
},
1880+
{
1881+
"source_path_from_root": "/docs/csharp/misc/cs0473.md",
1882+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1883+
},
1884+
{
1885+
"source_path_from_root": "/docs/csharp/misc/cs0531.md",
1886+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1887+
},
1888+
{
1889+
"source_path_from_root": "/docs/csharp/misc/cs0535.md",
1890+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1891+
},
18401892
{
18411893
"source_path_from_root": "/docs/csharp/misc/cs0501.md",
18421894
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/partial-declarations"
@@ -1865,6 +1917,30 @@
18651917
"source_path_from_root": "/docs/csharp/misc/cs0526.md",
18661918
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/constructor-errors#constructor-declarations"
18671919
},
1920+
{
1921+
"source_path_from_root": "/docs/csharp/misc/cs0538.md",
1922+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1923+
},
1924+
{
1925+
"source_path_from_root": "/docs/csharp/misc/cs0539.md",
1926+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1927+
},
1928+
{
1929+
"source_path_from_root": "/docs/csharp/misc/cs0540.md",
1930+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1931+
},
1932+
{
1933+
"source_path_from_root": "/docs/csharp/misc/cs0541.md",
1934+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1935+
},
1936+
{
1937+
"source_path_from_root": "/docs/csharp/misc/cs0550.md",
1938+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1939+
},
1940+
{
1941+
"source_path_from_root": "/docs/csharp/misc/cs0551.md",
1942+
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/interface-implementation-errors"
1943+
},
18681944
{
18691945
"source_path_from_root": "/docs/csharp/misc/cs0553.md",
18701946
"redirect_url": "/dotnet/csharp/language-reference/compiler-messages/overloaded-operator-errors"

docs/csharp/language-reference/compiler-messages/cs0071.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/csharp/language-reference/compiler-messages/cs0106.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

docs/csharp/language-reference/compiler-messages/cs0686.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)