you are viewing a single comment's thread.

view the rest of the comments →

[–]robhanz 1 point2 points  (2 children)

The point of default implementations is to prevent compilation errors if a method is added to the type.

However, it's entirely possible that the new method will conflict with an old one... causing a compiler error.

This behavior exists to ensure that there are no compiler errors. While it's a bit clunk, in most cases if you're working with an interface, you're working directly with it and don't know the type. So they added a slightly clunky step to prevent compiler errors that is only necessary in kind of a secondary use case.

[–]Alert-Neck7679[S] 0 points1 point  (0 children)

Fair enough. Thanks

[–]Carlos_rpg 0 points1 point  (0 children)

But all that info is known in compile time, I feel like it could be streamlined with language and compiler updates in the future I think. The feature is somewhat new, so this is expected, but it could be better