通常有两种方法可以实现此目的。
选项1 :添加另一个参数来
IGarrage表示
T应该传递给
IGenericCar<T>约束的参数:
interface IGarrage<TCar,TOther> where TCar : IGenericCar<TOther> { ... }选项2 :定义一个基本接口,
IGenericCar<T>该接口不是通用接口,并且针对该接口进行约束
interface IGenericCar { ... }interface IGenericCar<T> : IGenericCar { ... }interface IGarrage<TCar> where TCar : IGenericCar { ... }


