So, I have a interface:
interface A<SomeType>
{
SomeType Abc(SomeType);
.....
}
and I have an class:
class B<ShouldBeClassA<AnyType>>
where ShouldBeClassA<AnyType> : A<AnyType>
{ ShouldBeClassA<AnyType> someVariable; .....}
But this is causes syntax error's, what i want, is to force someVariable to be derivative of
A<AnyType>
so i can do that:
class B......
{
....
void Method()
{
someVariable.Abc(anyTypeVariable);
}
......}
Can u pls tell me, how to fix that?
Here is the actual code:
public interface IGenericTeacher<Genome<GenomeType>>
where Genome<GenomeType> : IGenome<GenomeType>
{
/// <summary>
/// Pass the tests and save the results.
/// </summary>
void PassTests();
/// <summary>
/// Passing generation, according to the results.
/// </summary>
void PassGeneration();
}
public interface IGenome<GenomeType>
{
.......
where ShouldBeClassA<AnyType>> : A<AnyType>has an extra>, that's your syntax error.whereis. Ive suggested an edit to the title and tags to reflect this.