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

LinearSeqOps suffers from brittle inheritance #128

Open
som-snytt opened this issue Aug 16, 2022 · 0 comments
Open

LinearSeqOps suffers from brittle inheritance #128

som-snytt opened this issue Aug 16, 2022 · 0 comments

Comments

@som-snytt
Copy link

Transferred from scala/bug#11697

LinearSeqOps isEmpty, head, tail are nominally abstract, but inherit concrete implementations that are broken.

It's not currently possible to enforce that these methods are overridden in subclasses of LinearSeqOps. Practically, they are overridden in the concrete subclass that extends both LinearSeq and LinearSeqOps.

A different set of internal API ("template methods") for coordinating these "fundamental methods" might improve the situation for a future iteration of the library.

Dotty has a ticket about how to handle abstract methods overriding concrete, so maybe that language change would suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant