C# Generic Method, cannot implicit convert

前端 未结 4 1357
旧时难觅i
旧时难觅i 2021-01-11 20:32

I\'ve got the following code:

public static T GetCar() where T : ICar
{
    T objCar = default(T);

    if (typeof(T) == typeof(SmallCar)) {
                


        
4条回答
提交回复
热议问题