You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standard/classes.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3951,7 +3951,9 @@ For an override property `P` declared in an interface `I`, the overridden base p
3951
3951
3952
3952
The override declaration and the overridden base property are required to have the same declared accessibility. In other words, an override declaration shall not change the accessibility of the base property. However, if the overridden base property is protected internal and it is declared in a different assembly than the assembly containing the override declaration then the override declaration’s declared accessibility shall be protected. The overriding property's type shall be at least as accessible as the overriding property. If the inherited property has only a single accessor (i.e., if the inherited property is read-only or write-only), the overriding property shall include only that accessor. If the inherited property includes both accessors (i.e., if the inherited property is read-write), the overriding property can include either a single accessor or both accessors. There shall be an identity conversion or (if the inherited property is read-only and has a value return) an implicit reference conversion between the type of the overriding and the inherited property. For an override property declared in an interface, there shall also be an identity conversion or (if the inherited property is read-only and has a value return) an implicit reference conversion between the type of the overriding property and the type of every override of the overridden base property that is declared in a (direct or indirect) base interface of the overriding property.
3953
3953
3954
-
An overriding property declaration may include the `sealed` modifier. Use of this modifier prevents a derived class from further overriding the property. The accessors of a sealed property are also sealed.
Copy file name to clipboardExpand all lines: standard/expressions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -583,7 +583,7 @@ For each argument in an argument list there has to be a corresponding parameter
583
583
584
584
The parameter list used in the following is determined as follows:
585
585
586
-
- For virtual methods and indexers defined in classes, the parameter list is picked from the first declaration or override of the function member found when starting with the static type of the receiver, and searching through its base classes. For virtual methods and indexers defined in interfaces, the parameter list is picked from the declaration or override of the function member found in the most derived type among those types containing the declaration of override of the function member. It is a compile-time error if no unique such type exists.
586
+
- For virtual methods and indexers defined in classes, the parameter list is picked from the first declaration or override of the function member found when starting with the static type of the receiver, and searching through its base classes. For virtual methods and indexers defined in interfaces, the parameter list is picked from the declaration or override of the function member found in the most derived interface among the static type of the receiver and its direct and indirect base interfaces that contains a declaration or override of the function member. It is a compile-time error if no unique such most derived interface exists.
587
587
- For partial methods, the parameter list of the defining partial method declaration is used.
588
588
- For all other function members and delegates there is only a single parameter list, which is the one used.
589
589
@@ -1973,7 +1973,7 @@ The optional *argument_list* ([§12.6.2](expressions.md#1262-argument-lists)) pr
1973
1973
The result of evaluating an *invocation_expression* is classified as follows:
1974
1974
1975
1975
- If the *invocation_expression* invokes a returns-no-value method ([§15.6.1](classes.md#1561-general)) or a returns-no-value delegate, the result is nothing. An expression that is classified as nothing is permitted only in the context of a *statement_expression* ([§13.7](statements.md#137-expression-statements)) or as the body of a *lambda_expression* ([§12.21](expressions.md#1221-anonymous-function-expressions)). Otherwise, a binding-time error occurs.
1976
-
- Otherwise, if the *invocation_expression* invokes a returns-by-ref method ([§15.6.1](classes.md#1561-general)) or a returns-by-ref delegate, the result is a variable with an associated type of the return type of the method or delegate. If the invocation is of an instance method, and the receiver is of a class type `T`, the associated type is picked from the first declaration or override of the method found when starting with `T` and searching through its base classes.
1976
+
- Otherwise, if the *invocation_expression* invokes a returns-by-ref method ([§15.6.1](classes.md#1561-general)) or a returns-by-ref delegate, the result is a variable with an associated type of the return type of the method or delegate. If the invocation is of an instance method, and the receiver is of a class type `T`, the associated type is picked from the first declaration or override of the method found when starting with `T` and searching through its base classes. If the invocation is of an instance method, and the receiver is of an interface type `T`, the associated type is picked from the declaration of the method found in the most specific (§19.4.10) interface from among `T` and its direct and indirect base interfaces. It is a compile-time error if no unique such type exists.
1977
1977
- Otherwise, the *invocation_expression* invokes a returns-by-value method ([§15.6.1](classes.md#1561-general)) or returns-by-value delegate, and the result is a value, with an associated type of the return type of the method or delegate. If the invocation is of an instance method, and the receiver is of a class type `T`, the associated type is picked from the first declaration or override of the method found when starting with `T` and searching through its base classes. If the invocation is of an instance method, and the receiver is of an interface type `T`, the associated type is picked from the declaration or override of the method found in the most specific ([§19.4.10](interfaces.md#19410-most-specific-implementation)) interface from among `T` and its direct and indirect base interfaces. It is a compile-time error if no unique such type exists.
Copy file name to clipboardExpand all lines: standard/interfaces.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -892,7 +892,7 @@ A *type_parameter_constraints_clause* on an explicit interface method implementa
892
892
893
893
For an explicit interface member implementation to be valid, the class, struct, or interface shall name an interface in its base class or base interface list that contains a member whose qualified interface member name, type, number of type parameters, and parameter types exactly match those of the explicit interface member implementation. If an interface function member has a parameter array, the corresponding parameter of an associated explicit interface member implementation is allowed, but not required, to have the `params` modifier. If the interface function member does not have a parameter array then an associated explicit interface member implementation shall not have a parameter array.
894
894
895
-
For an explicit interface member implementation of a method, property, or indexer that has a return type, there shall be an identity conversion or an implicit reference conversion from the return type of the explicit interface member implementation to the return type of every override of the interface member that is declared in a (directorindirect) base interface.
895
+
For an explicit interface member implementation of a method, property, or indexer that has a return type, there shall be an identity conversion or (ifthememberhasavaluereturn) animplicitreferenceconversionfromthereturntypeoftheexplicitinterfacememberimplementationtothereturntypeofeveryoverrideoftheinterfacememberthatisdeclaredina (directorindirect) baseinterface.
896
896
897
897
> *Example*:Thus, inthefollowingclass
898
898
>
@@ -1101,12 +1101,10 @@ Members of a constructed interface type are considered to have any type paramete
1101
1101
1102
1102
Forpurposesofinterfacemapping, a class, interface, or struct member `A` matches an interface member `B` when:
1103
1103
1104
-
- `A` and `B` aremethods, andthename, type, andparameterlistsof `A` and `B` areidentical, andthereturntypeof `A` isconvertibletothereturntypeof `B` viaanidentityorimplicitreferenceconversion.
1105
-
- `A` and `B` areproperties, thenameof `A` and `B` areidentical, `A` hasthesameaccessorsas `B` (`A` ispermittedtohaveadditionalaccessorsifitisnotanexplicitinterfacememberimplementation), andthetypeof `A` isconvertibletothetypeof `B` viaanidentityconversionor, if `A` isareadonlyproperty, animplicitreferenceconversion.
1104
+
- `A` and `B` aremethods, andthename, type, andparameterlistsof `A` and `B` areidentical.
1105
+
- `A` and `B` areproperties, thenameandtypeof `A` and `B` areidentical, and`A` hasthesameaccessorsas `B` (`A` ispermittedtohaveadditionalaccessorsifitisnotanexplicitinterfacememberimplementation).
1106
1106
- `A` and `B` areevents, andthenameandtypeof `A` and `B` areidentical.
1107
-
- `A` and `B` areindexers, theparameterlistsof `A` and `B` areidentical, `A` hasthesameaccessorsas `B` (`A` ispermittedtohaveadditionalaccessorsifitisnotanexplicitinterfacememberimplementation), andthetypeof `A` isconvertibletothetypeof `B` viaanidentityconversionor, if `A` isareadonlyindexer, animplicitreferenceconversion.
0 commit comments