|
|
|
|
|
by 4ad
3586 days ago
|
|
It doesn't work well with interfaces. A method defined in a new package might break a type switch (or some reflection-based code) in another package. Plus it's unclear what should happen with interfaces when multiple packages define methods with the same name. |
|
In that case the code would break because it assumes too much. If the language was designed differently, people would code differently too. This is like having a Java abstract class which "knows" all the possible subclasses in advance: if it breaks, it is the responsibility of that abstract class for having too much coupling.
> Plus it's unclear what should happen with interfaces when multiple packages define methods with the same name.
I am not sure I understand: if methods are defined in different packages, they have different qualified names, don't they? is there any ambiguity here?