Hi,
So i have such code.
public interface IGeoDataSet<out T> : IDataSet
where T : IGeoPrimitive<IGeoPrimitiveContent>
{
IEnumerable<T> Items { get; }
}
public interface IDataSet { }
public interface IGeoPrimitive<T> : IPrimitive
where T : IGeoPrimitiveContent
{
T Content { get; }
}
public interface IPrimitive { }
public interface IGeoPrimitiveContent { }
And such inplementation for previous interfaces.
public class TriangleDataSet : IGeoDataSet<Triangle>
{
public IEnumerable<Triangle> Items { get; private set; }
}
public class Triangle : IGeoPrimitive<TriangleContent>
{
public TriangleContent Content { get; private set; }
}
public class TriangleContent : IGeoPrimitiveContent { }
When I try to compile this code I've got an error:
The type '.Triangle' cannot be used as type parameter 'T' in the generic type or method '.IGeoDataSet<T>'. There is no implicit reference conversion from '.Triangle' to '.IGeoPrimitive<.IGeoPrimitiveContent>'.
I can't understand why, maybe someone knows what is the problem?
Br, Jevgenij