Commit 2def921
authored
add return type other than Unit onto the prepend() function in trait 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()))```1 parent 45a0338 commit 2def921
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments