Skip to content

Commit db1a15c

Browse files
committed
second edit pass.
1 parent 8c7807b commit db1a15c

File tree

2 files changed

+40
-29
lines changed

2 files changed

+40
-29
lines changed

.github/prompts/error-consolidation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 error instance of the same message matches exactly.

docs/csharp/language-reference/compiler-messages/explicit-interface-errors.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,39 +62,39 @@ This article covers the following compiler errors:
6262
That's by design. The text closely matches the text of the compiler error / warning for SEO purposes.
6363
-->
6464
- [**CS0071**](#interface-declaration-and-syntax): *An explicit interface implementation of an event must use event accessor syntax*
65-
- [**CS0106**](#interface-declaration-and-syntax): *The modifier 'modifier' is not valid for this item*
66-
- [**CS0277**](#accessor-implementation-and-conflicts): *'class' does not implement interface member 'accessor'. 'class accessor' is not public*
67-
- [**CS0425**](#generic-type-constraints): *The constraints for type parameter 'type parameter' of method 'method' must match the constraints for type parameter 'type parameter' of interface method 'method'. Consider using an explicit interface implementation instead.*
68-
- [**CS0460**](#generic-type-constraints): *Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly*
69-
- [**CS0470**](#accessor-implementation-and-conflicts): *Method 'method' cannot implement interface accessor 'accessor' for type 'type'. Use an explicit interface implementation.*
65+
- [**CS0106**](#interface-declaration-and-syntax): *The modifier '{0}' is not valid for this item*
66+
- [**CS0277**](#accessor-implementation-and-conflicts): *'{0}' does not implement interface member '{1}'. '{2}' is not public.*
67+
- [**CS0425**](#generic-type-constraints): *The constraints for type parameter '{0}' of method '{1}' must match the constraints for type parameter '{2}' of interface method '{3}'. Consider using an explicit interface implementation instead.*
68+
- [**CS0460**](#generic-type-constraints): *Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly, except for either a 'class', or a 'struct' constraint.*
69+
- [**CS0470**](#accessor-implementation-and-conflicts): *Method '{0}' cannot implement interface accessor '{1}' for type '{2}'. Use an explicit interface implementation.*
7070
- [**CS0473**](#ambiguous-and-conflicting-implementations): *Explicit interface implementation 'method name' matches more than one interface member. Which interface member is actually chosen is implementation-dependent. Consider using a non-explicit implementation instead.*
71-
- [**CS0531**](#interface-declaration-and-syntax): *'member' : interface members cannot have a definition*
72-
- [**CS0535**](#missing-or-incomplete-implementations): *'class' does not implement interface member 'member'*
73-
- [**CS0538**](#interface-declaration-and-syntax): *'name' in explicit interface declaration is not an interface*
74-
- [**CS0539**](#member-matching-and-resolution): *'member' in explicit interface declaration is not a member of interface*
75-
- [**CS0540**](#member-matching-and-resolution): *'interface member' : containing type does not implement interface 'interface'*
76-
- [**CS0541**](#interface-declaration-and-syntax): *'declaration' : explicit interface declaration can only be declared in a class or struct*
77-
- [**CS0550**](#missing-or-incomplete-implementations): *'accessor' adds an accessor not found in interface member 'property'*
78-
- [**CS0551**](#missing-or-incomplete-implementations): *Explicit interface implementation 'implementation' is missing accessor 'accessor'*
79-
- [**CS0630**](#special-implementation-restrictions): *'method' cannot implement interface member 'member' in type 'type' because it has an __arglist parameter*
80-
- [**CS0686**](#accessor-implementation-and-conflicts): *Accessor 'accessor' cannot implement interface member 'member' for type 'type'. Use an explicit interface implementation.*
81-
- [**CS0736**](#method-visibility-and-modifiers): *'type name' does not implement interface member 'member name'. 'method name' cannot implement an interface member because it is static.*
82-
- [**CS0737**](#method-visibility-and-modifiers): *'type name' does not implement interface member 'member name'. 'method name' cannot implement an interface member because it is not public.*
83-
- [**CS0738**](#return-types-and-signatures): *'type name' does not implement interface member 'member name'. 'method name' cannot implement 'interface member' because it does not have the matching return type of 'type name'.*
84-
- [**CS8705**](#ambiguous-and-conflicting-implementations): *Interface member 'member' does not have a most specific implementation. Neither 'implementation1', nor 'implementation2' are most specific.*
85-
- [**CS8854**](#return-types-and-signatures): *'type' does not implement interface member 'member'. 'implementation' cannot implement 'member' because it does not have the matching 'init' setter of 'property'.*
86-
- [**CS9333**](#return-types-and-signatures): *Parameter type must match implemented member declaration.*
87-
- [**CS9334**](#return-types-and-signatures): *Return type must match implemented member declaration.*
71+
- [**CS0531**](#interface-declaration-and-syntax): *'{0}': interface members cannot have a definition*
72+
- [**CS0535**](#missing-or-incomplete-implementations): *'{0}' does not implement interface member '{1}'*
73+
- [**CS0538**](#interface-declaration-and-syntax): *'{0}' in explicit interface declaration is not an interface*
74+
- [**CS0539**](#member-matching-and-resolution): *'{0}' in explicit interface declaration is not found among members of the interface that can be implemented*
75+
- [**CS0540**](#member-matching-and-resolution): *'{0}': containing type does not implement interface '{1}'*
76+
- [**CS0541**](#interface-declaration-and-syntax): *'{0}': explicit interface declaration can only be declared in a class, record, struct or interface*
77+
- [**CS0550**](#missing-or-incomplete-implementations): *'{0}' adds an accessor not found in interface member '{1}'*
78+
- [**CS0551**](#missing-or-incomplete-implementations): *Explicit interface implementation 'implementation' is missing accessor 'accessor'.*
79+
- [**CS0630**](#special-implementation-restrictions): *'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter*
80+
- [**CS0686**](#accessor-implementation-and-conflicts): *Accessor '{0}' cannot implement interface member '{1}' for type '{2}'. Use an explicit interface implementation.*
81+
- [**CS0736**](#method-visibility-and-modifiers): *'{0}' does not implement instance interface member '{1}'. '{2}' cannot implement the interface member because it is static.*
82+
- [**CS0737**](#method-visibility-and-modifiers): *'{0}' does not implement interface member '{1}'. '{2}' cannot implement an interface member because it is not public.*
83+
- [**CS0738**](#return-types-and-signatures): *'{0}' does not implement interface member '{1}'. '{2}' cannot implement '{1}' because it does not have the matching return type of '{3}'.*
84+
- [**CS8705**](#ambiguous-and-conflicting-implementations): *Interface member '{0}' does not have a most specific implementation. Neither '{1}', nor '{2}' are most specific.*
85+
- [**CS8854**](#return-types-and-signatures): *'{0}' does not implement interface member '{1}'. '{2}' cannot implement '{1}'.*
86+
- [**CS9333**](#return-types-and-signatures): *'{0}': type must be '{1}' to match implemented member '{2}'*
87+
- [**CS9334**](#return-types-and-signatures): *'{0}': return type must be '{1}' to match implemented member '{2}'*
8888

8989
## Interface declaration and syntax
9090

9191
The following errors relate to proper syntax and structure when declaring explicit interface implementations:
9292

9393
- **CS0071**: *An explicit interface implementation of an event must use event accessor syntax*
9494
- **CS0106**: *The modifier 'modifier' is not valid for this item*
95-
- **CS0531**: *'member' : interface members cannot have a definition*
95+
- **CS0531**: *'{0}': interface members cannot have a definition*
9696
- **CS0538**: *'name' in explicit interface declaration is not an interface*
97-
- **CS0541**: *'declaration' : explicit interface declaration can only be declared in a class or struct*
97+
- **CS0541**: *'{0}': explicit interface declaration can only be declared in a class, record, struct or interface*
9898

9999
You can correct these errors using the following techniques:
100100

@@ -111,7 +111,7 @@ For more information, see [Interfaces](../../fundamentals/types/interfaces.md),
111111

112112
The following errors occur when a class fails to fully implement an interface or implements members that don't match the interface contract:
113113

114-
- **CS0535**: *'class' does not implement interface member 'member'*
114+
- **CS0535**: *'{0}' does not implement interface member '{1}'*
115115
- **CS0550**: *'accessor' adds an accessor not found in interface member 'property'*
116116
- **CS0551**: *Explicit interface implementation 'implementation' is missing accessor 'accessor'*
117117

@@ -143,8 +143,8 @@ For more information, see [Interfaces](../../fundamentals/types/interfaces.md),
143143

144144
The following errors occur when attempting to implement interface members that don't exist in the interface or when the containing type doesn't declare the interface:
145145

146-
- **CS0539**: *'member' in explicit interface declaration is not a member of interface*
147-
- **CS0540**: *'interface member' : containing type does not implement interface 'interface'*
146+
- **CS0539**: *'{0}' in explicit interface declaration is not found among members of the interface that can be implemented*
147+
- **CS0540**: *'{0}': containing type does not implement interface '{1}'*
148148

149149
You can correct these errors using the following techniques:
150150

@@ -173,8 +173,8 @@ For more information, see [Constraints on type parameters](../../programming-gui
173173

174174
The following errors occur when implementing interface methods with incorrect accessibility or modifiers:
175175

176-
- **CS0736**: *'type name' does not implement interface member 'member name'. 'method name' cannot implement an interface member because it is static.*
177-
- **CS0737**: *'type name' does not implement interface member 'member name'. 'method name' cannot implement an interface member because it is not public.*
176+
- **CS0736**: *'{0}' does not implement instance interface member '{1}'. '{2}' cannot implement the interface member because it is static.*
177+
- **CS0737**: *'{0}' does not implement interface member '{1}'. '{2}' cannot implement an interface member because it is not public.*
178178

179179
You can correct these errors using the following techniques:
180180

0 commit comments

Comments
 (0)