File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,13 @@ case class Nil[+B]() extends Node[B] {
5858
5959Now we can do the following:
6060``` tut
61- trait Mammal
62- case class AfricanSwallow() extends Mammal
63- case class EuropeanSwallow() extends Mammal
61+ trait Bird
62+ case class AfricanSwallow() extends Bird
63+ case class EuropeanSwallow() extends Bird
6464
6565
6666val africanSwallowList= ListNode[AfricanSwallow](AfricanSwallow(), Nil())
67- val mammalList : Node[Mammal ] = africanSwallowList
68- mammalList .prepend(new EuropeanSwallow)
67+ val birdList : Node[Bird ] = africanSwallowList
68+ birdList .prepend(new EuropeanSwallow)
6969```
70- The ` Node[Mammal ] ` can be assigned the ` africanSwallowList ` but then accept ` EuropeanSwallow ` s.
70+ The ` Node[Bird ] ` can be assigned the ` africanSwallowList ` but then accept ` EuropeanSwallow ` s.
You can’t perform that action at this time.
0 commit comments