Skip to content

add return type other than Unit onto the prepend() function in trait … #919

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

Merged
merged 1 commit into from
Nov 18, 2017

Conversation

justinpermar
Copy link
Contributor

…Bird

I don't think this page intends to have a Unit return type for prepend. Without it, prepend() doesn't do anything useful: scala> birdList.prepend(new EuropeanSwallow) returns Unit. So add the return type so prepend() does what the reader expects it to. With the suggested change, I get scala> birdList.prepend(new EuropeanSwallow) res16: Node[Bird] = ListNode(EuropeanSwallow(),ListNode(AfricanSwallow(),Nil()))

…Bird

I don't think this page intends to have a Unit return type for prepend. Without it, prepend() doesn't do anything useful: ```scala> birdList.prepend(new EuropeanSwallow)``` returns Unit. So add the return type so prepend() does what the reader expects it to. With the suggested change, I get ```scala> birdList.prepend(new EuropeanSwallow)
res16: Node[Bird] = ListNode(EuropeanSwallow(),ListNode(AfricanSwallow(),Nil()))```
@SethTisue SethTisue merged commit c7eb44c into scala:master Nov 18, 2017
@SethTisue
Copy link
Member

good catch, thanks!

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.

2 participants