Skip to content

Commit dfd4594

Browse files
authored
Add covariant return types feature
1 parent 4271fad commit dfd4594

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

standard/interfaces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,10 +1099,10 @@ Members of a constructed interface type are considered to have any type paramete
10991099
11001100
For purposes of interface mapping, a class, interface, or struct member `A` matches an interface member `B` when:
11011101
1102-
- `A` and `B` are methods, and the name, type, and parameter lists of `A` and `B` are identical.
1103-
- `A` and `B` are properties, the name and type of `A` and `B` are identical, and `A` has the same accessors as `B` (`A` is permitted to have additional accessors if it is not an explicit interface member implementation).
1102+
- `A` and `B` are methods, and the name, type, and parameter lists of `A` and `B` are identical, and the return type of `A` is convertible to the return type of `B` via an identity of implicit reference conversion to the return type of `B`.
1103+
- `A` and `B` are properties, the name of `A` and `B` are identical, `A` has the same accessors as `B` (`A` is permitted to have additional accessors if it is not an explicit interface member implementation), and the type of `A` is convertible to the return type of `B` via an identity conversion or, if `A` is a readonly property, an implicit reference conversion.
11041104
- `A` and `B` are events, and the name and type of `A` and `B` are identical.
1105-
- `A` and `B` are indexers, the type and parameter lists of `A` and `B` are identical, and `A` has the same accessors as `B` (`A` is permitted to have additional accessors if it is not an explicit interface member implementation).
1105+
- `A` and `B` are indexers, the parameter lists of `A` and `B` are identical, `A` has the same accessors as `B` (`A` is permitted to have additional accessors if it is not an explicit interface member implementation), and the type of `A` is convertible to the return type of `B` via an identity conversion or, if `A` is a readonly indexer, an implicit reference conversion.
11061106
11071107
Notable implications of the interface-mapping algorithm are:
11081108

0 commit comments

Comments
 (0)