Код: Выделить всё
public interface IA
{
TValue? GetValue();
}
public class A : IA
{
public TValue? GetValue()
{
...
if (value is not null)
return (TValue)value;
return default(TValue);
}
}
Код: Выделить всё
public interface IA
{
TValue? GetValue();
}
public class A : IA
{
TValue? IA.GetValue()
{
...
if (value is not null)
return (TValue)value;
return default(TValue);
}
}
Код: Выделить всё
Cannot implicitly convert type TValue to TValue?
Это ошибка или я что-то упустил?
Подробнее здесь: https://stackoverflow.com/questions/791 ... neric-type
Мобильная версия