But if ln were aliased with li, then it would break the type-safety promise implicit in the definition of li — that it is a list of integers, which is why generic types cannot be covariant.
但是如果ln是li的别名,那么这就破坏了蕴含在li定义中的类型安全承诺——它是一个整数列表,这就是泛型类型不能协变的原因。
But if ln were aliased with li, then it would break the type-safety promise implicit in the definition of li — that it is a list of integers, which is why generic types cannot be covariant.
但是如果ln是li的别名,那么这就破坏了蕴含在li定义中的类型安全承诺——它是一个整数列表,这就是泛型类型不能协变的原因。
应用推荐