Skip to content

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