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
We decided that the best design for the base(I).M feature would be that we lookup M in the interface type I, and the result must be accessible. Moreover, there is a requirement that if the found member is abstract, the type I must have a unique most specific (concrete) implementation in the type I. The compiler would emit IL that identifies the method found, and the type I, and the runtime would select the most specific (concrete) implementation in the type I and invoke it (or throw an exception if there is no unique most specific implementation at runtime). There is no IL defined today that would serve this purpose, so we would have to design it. (One option would be to generate a "constrained" prefix with the interface type I). The IL should not assume or require that the implementing method is accessible to the caller (e.g. it could be private), but it does require that the declared method named in the IL is accessible.
base(T) phase two
Summary
We decided that the best design for the
base(I).M
feature would be that we lookupM
in the interface typeI
, and the result must be accessible. Moreover, there is a requirement that if the found member is abstract, the typeI
must have a unique most specific (concrete) implementation in the typeI
. The compiler would emit IL that identifies the method found, and the typeI
, and the runtime would select the most specific (concrete) implementation in the typeI
and invoke it (or throw an exception if there is no unique most specific implementation at runtime). There is no IL defined today that would serve this purpose, so we would have to design it. (One option would be to generate a "constrained" prefix with the interface typeI
). The IL should not assume or require that the implementing method is accessible to the caller (e.g. it could be private), but it does require that the declared method named in the IL is accessible.Design meetings
https://github.com/dotnet/csharplang/blob/main/meetings/2019/LDM-2019-02-27.md
https://github.com/dotnet/csharplang/blob/main/meetings/2019/LDM-2019-04-29.md#default-interface-implementations-and-base-calls
The text was updated successfully, but these errors were encountered: