-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test plan for "default interface implementations" #19217
Comments
/cc @jcouv @AlekseyTs |
Some ideas from a recent PR for your consideration (you evaluate the risk and decide if it's worthwhile to cover):
Consider benchmarking the feature. Also, we may need to update some analyzer and our public API compat tracker. It's probably good to notify CoreFX team to do the same. |
Also EnC for this feature. |
FYI @AlekseyTs |
@AlekseyTs If you could please annotate each bullet items with the name of a test, I will verify them and check them off. |
FYI I did some manual IDE validation and checked off a few more bullets above. |
EnC support is done: #37115 |
@AlekseyTs Please reassign to me after you have marked each bullet with a test that covers that item. |
This is a test plan for the "default interface implementation" language feature. For reference, see also:
csharplang
repoMeta items
class
orstruct
contexts, but notinterface
. Maybe they should be updated to allowinterface
too. For example,SkipLocalsInitAttribute
.Productivity
interface I { public void M(); }
Test Functional Changes
object.MemberwiseClone()
on itselfvirtual
by defaultabstract
is permitted where redundant.abstract
is forbidden onprivate
memberssealed
can be used to make members non-virtual (every access level)Test that interfaces can be partial[This is not part of the feature, partial interfaces are already supported]Main
method in an interface. [Unit-testsEntryPoint_*
]base(I).M
whereM
is defined and implemented inI
.base(I).M
whereM
is defined inI
's base and implemented inI
.base(I).M
whereM
is defined and implemented inI
's base (an error)base(object).M
whereM
is apublic
/protected
member inobject
.base(I).M
for virtual method whose implementation is inherited into I (an error)base(I).M
for virtual method whose implementation is now inherited into I (a runtime error at the call site)base(I).M
methodbase(C).M
forC
a class. (methods and other members).M
may not be inherited (even for a constant, field, nonvirtual method) https://github.com/dotnet/csharplang/blob/master/meetings/2019/LDM-2019-02-27.md#semantics-of-basetmemberbase(I).M
for non-virtual method inherited into I (an error)this
is of the type of the interface and isreadonly
.extern
modifier is permitted on interface members.abstract
orpublic
orsealed
may be written in an interface where it is redundant (except...)sealed
.this
is boxed by the callunsafe
code worksLambdaCaching_*
in https://github.com/Ensure synthesized BoundBaseReference always uses correct type. #34500]BaseAccessWrapper_01
in https://github.com/Ensure synthesized BoundBaseReference always uses correct type. #34500]override
keyword is forbiddenbase(object)
works in an interfacebase(I)
also finds members ofobject
.using static
works as expected when the named type is an interface.IDE Tests
base(Type)
[ The following issues are tracked in https://github.com/DefaultInterfaceImplementation open issues and work items #17952: No recommendation/completion for types within base(...) expression. For base access, when the explicit base is an interface, interface members are not suggested, members of the immediate base class are suggested instead. For base access, when the explicit base is a class, members of the immediate base class are suggested regardless of the actual class specified.]<enter>
in an unfinished statement indents the next linecontrol-F12
to navigate from virtual member to implementationsextract method
worksSome ideas from a recent PR for your consideration (you evaluate the risk and decide if it's worthwhile to cover):
select x from IMyIEnumerableWithSelect
,select object x from IMyIEnumerableWithCast
)Consider benchmarking the feature.
Also, we may need to update some analyzer and our public API compat tracker. It's probably good to notify CoreFX team to do the same.
The text was updated successfully, but these errors were encountered: