Last active
April 16, 2020 19:05
-
-
Save FabP93/788bf342dc5c63da9b1e67f3d6d32a35 to your computer and use it in GitHub Desktop.
Mixing generics and Subtypes Part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pushups = Array<Pushup>() | |
// This doesn't raise any error because built-in | |
// generic types are covariant. | |
var exercises: Array<Exercise> = pushups |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment