-
Notifications
You must be signed in to change notification settings - Fork 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
Allow classes to call interface methods with default implementations #3705
Comments
Default implementations are not a member of the class. You can think of them more like explicit implementations, but managed by the runtime. |
Yes, I understand, however I still propose that this be changed. I think classes that implement interfaces with default implementations should be consistent with interfaces that derive from interfaces. It seems inconsistent the way it is now and the |
Isn't this what's supposed to be solved by |
Similar issue #2881 |
If you have an interface with a method that has a default implementation, and a target class that implements that interface, the target class cannot call methods in the interface with default implementations unless it overrides them. It can call methods that do not have default implementations when the target class implements the method.
I think it should allow the target class to call the same methods that an interface that derives from that interface can call. Seems a bit inconsistent to me.
Technically there is this workaround but it is quite silly:
The text was updated successfully, but these errors were encountered: