我有以下场景
class Human {}
class Child: Human {}
class Person<T: Human> {}
var people = [Person<Human>]()
people.append(Person<Child>())
Run Code Online (Sandbox Code Playgroud)
但是在线上people.append(Person<Child>())我收到了错误
cannot convert value of type 'Person<Child>' to expected argument type 'Person<Human>'
Run Code Online (Sandbox Code Playgroud)
做下面的工作(这似乎是一个相同的情况)真的很奇怪
var myArray = [Array<UIView>]()
myArray.append(Array<UIImageView>())
Run Code Online (Sandbox Code Playgroud)
有人会理解为什么一种方式有效而不是另一种方式?