Hacker News new | ask | show | jobs
by cefstat 3862 days ago
There is something in the article that looks wrong. It's suggesting that `let returnsCat: () -> Cat = animalF` should work, where `animalF` returns `Animal`. The Swift playground agrees with my understanding that this is not correct: "Cannot convert value of type '() -> Animal' to specified type '() -> Cat'".
1 comments

I think is just a matter of editing, the line "It even works with functions:" should probably say something like "It's even the same with functions" as before clearly stated that "let cat: Cat = Animal()" doens't work
"Editing"? You overestimate me. Anyway, thank you both for pointing this out, I've improved (I hope) the wording now.