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

Specialized traits design draft #21950

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 14, 2024

No description provided.

@hamzaremmal hamzaremmal self-assigned this Nov 14, 2024
def hasNext: Boolean
def next(): Int

trait ArrayIterator_Int extends ArrayIterator[Int], Iterator[Int]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odersky I've just tried it with 3.5.0 and it compiles fine with the following parents. But we agree that after erasure, we should have Iterator_Int anyways.

Suggested change
trait ArrayIterator_Int extends ArrayIterator[Int], Iterator[Int]
trait ArrayIterator_Int extends ArrayIterator[Int], Iterator_Int

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it does not work if you replace both uses, the one here and the one that would map Seq[Int] to Seq_Int.

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

Successfully merging this pull request may close these issues.

3 participants