Skip to content
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

The default implementation of an interface must not over-specify generic paramaters #3279

kevmoo opened this issue May 29, 2012 · 3 comments


Copy link

@kevmoo kevmoo commented May 29, 2012

This is a generalization of the issue raised in - Underspecified Set<T> and Map<K,V> semantics

A silly example: it should be illegal for the default implementation of the Zoo interface (for managing any animal) be LionCage (where you can manage any animal you want, as long as it's a Lion).

Not only should issue #472 be fixed in the library, I'd argue the current implementation should be forbidden by the runtime.

Copy link

@kasperl kasperl commented May 29, 2012

Added Area-Language, Triaged labels.

Copy link

@gbracha gbracha commented May 29, 2012

Unless we extensively revisit default implementations, this won't change. The flexibility is valuable.

Set owner to @gbracha.
Removed Type-Defect label.
Added Type-Enhancement, WontFix labels.

Copy link
Member Author

@kevmoo kevmoo commented May 29, 2012

At this point, I realize enforcing such a rule in the tools might be impractical.

At a minimum, I would strongly argue for a best practice strongly discouraging the practice.

Flexibility is great, but it must be balanced with the principle of least surprise.

...I was VERY surprised. :-)

I love the quick replies to these issues. Blown away by the opennesses of the project. Cheers.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants