CS0309: constraint has been violated. (possible bug?)

Does anyone know why the following doesn't work?

interface B is derrived from interface A, and should contain an implicit conversion from B to A
error CS0309: The type 'constraint_bug.interface_b<T>' must be convertible to 'constraint_bug.interface_a<constraint_bug.interface_b<T>>'
in order to use it as parameter 'T' in the generic type or method 'constraint_bug.do_something<T>(T)'



class constraint_bug
{
interface interface_a<T>
{
T some_func();
}

interface interface_b<T> : interface_a<T>
where T : interface_b<T>
{
void another_func();
}

staticvoid do_something<T>(T val) where T : interface_a<T>
{
val.some_func();
}

staticvoid do_another_thing<T>(interface_b<T> val)
{
do_something(val);// CS0309 (seems like a bug).
}
}

adding interface_a<interface_b<T>> as a constraint doesn't help.

[1479 byte] By [JoeR] at [2008-2-26]
# 1
you can post your bugs at the Product Feedback center for a quicker resolution and workarounds

[ http://labs.msdn.microsoft.com/productfeedback ]
Regards,
Saurabh Nandu
www.MasterCSharp.com
www.AksTech.com

SaurabhNandu-MVP at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# Language...