protocol Animal {}
struct Lion: Animal {}
protocol Zoo {
var animals: [Animal] { get }
}
struct BronxZoo: Zoo { // error: Type 'BronxZoo' does not conform to protocol 'Zoo'
var animals: [Lion] = []
}
If BronxZoo
has an animals
array of type Lion
, which conforms to Animal
, then why isn't BronxZoo
considered to be in conformance with Zoo
?