I have a compilation error and do not know how to fix it. This is the
first time I've tried to use a generic type constraint.
What have I done wrong?
public sealed class ClassA : IInput
{
...
}
public class ClassB<Twhere T : IInput
{
public ClassB() {...}
public IInput[] Generate()
{
Engine<Tengine = new Engine<T>();
IInput[] lst = engine.ReadFile(someFileName); <===== ERROR:
return lst;
}
}
ERROR: Cannot implicitly convert type 'T[]' to 'IInput[]'