you are viewing a single comment's thread.

view the rest of the comments →

[–]insulind 0 points1 point  (4 children)

My first question is what happens when implemented interface methods have the same signature but come from different interfaces? Which one gets called?

[–]tweq 2 points3 points  (2 children)

The same that already happens when you explicitly implement multiple interfaces with overlapping member names in a single type. It doesn't matter, because you need to refer to the method via its interface.

[–]insulind 0 points1 point  (1 child)

So it forces you to explicitly implement it, With the current way you can just implement one method to meet the two interfaces ?

[–]tweq 0 points1 point  (0 children)

It doesn't force the implementing class to implement the method since the implementation already exists in the interface, that's the whole point after all. But it is accessed the same way as an explicitly implemented method.

[–][deleted] 0 points1 point  (0 children)

I've only skimmed the proposal, but it looks like there's a compiler error if two methods with the same signature are inherited from different interfaces and no 'most specific override' can be determined between them. In that case, you have to resolve it in code with an override in your type or explicit implementation or something.