Commit 0530114
Fix incorrect statement about generic interface inheritance
The previous statement incorrectly claimed that generic interfaces can only inherit from non-generic interfaces if they are covariant. This is false - any generic interface can inherit from a non-generic interface regardless of variance.
The corrected text now:
1. States correctly that generic interfaces CAN inherit from non-generic interfaces (no conditions)
2. Explains that when this happens, the type parameter replaces 'object' in overridden members
3. Uses IEnumerable<T> as an example where T replaces object in output positions
4. Clarifies that because T is used only in output positions, the interface CAN be marked as covariant
5. Notes that if T were used in input positions, it couldn't be covariant
This addresses the issue raised in #43518 and incorporates Bill Wagner's clarification.
Co-authored-by: BillWagner <[email protected]>1 parent d7e3e42 commit 0530114
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments