Hacker News new | past | comments | ask | show | jobs | submit login

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'".



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: