[Mono-dev] Mono 2.8 regression

2010-12-20 Thread Federico Di Gregorio
Hi *, I guess it's my fault, not Mono's, but some code that compiled well on 2.6 doesn't work anymore on 2.8. I suppose this is somewhat related to covariance/contravariance of delegates but I'd like to have someone tell me «Eck! Whay did you do that? That's wrong!». Here is the error:

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Jb Evain
Hi, On Mon, Dec 20, 2010 at 10:01 AM, Federico Di Gregorio f...@initd.org wrote: I'd like to have someone tell me «Eck! Whay did you do that? That's wrong!». Eck! Why did you do that? That's wrong! (You're welcome ;) test.cs(15,16): error CS0030: Cannot convert type

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Tom Spink
Hello, There doesn't seem to be any relation between S and T - which means the types are incompatible, and so not eligible for generic type parameter variance. The reason is, the abstract function definition specifies a type constraint 'T' and even though your overridden method signature is

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Federico Di Gregorio
On 20/12/2010 10:15, Jb Evain wrote: On Mon, Dec 20, 2010 at 10:01 AM, Federico Di Gregorio f...@initd.org wrote: I'd like to have someone tell me «Eck! Whay did you do that? That's wrong!». Eck! Why did you do that? That's wrong! (You're welcome ;) test.cs(15,16): error CS0030:

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Tom Spink
Hello, You could propagate the abstract method type parameter out to the class definition: /// public abstract class AT { public abstract Funcstring, int, T GetXXX(); } /// Then, override as follows: /// public class CT : AT { Funcstring, int, T xxx; public override Funcstring, int, T

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Federico Di Gregorio
On 20/12/2010 11:11, Tom Spink wrote: You could propagate the abstract method type parameter out to the class definition: Unfortunately I can't have a generic abstract class because I need: DictionaryType,A precompiledExpressionsByType; and then, in other parts of the library: X result =

Re: [Mono-dev] Mono 2.8 regression

2010-12-20 Thread Tom Spink
It should run fine, as it's /probably/ doing what the cast to object is doing... But, of course, it violates type-safety so the compiler moans at you. Like I suggested, if you cast to object, then cast to the delegate, this'll get round the compilation error. -- Spink On 20 December 2010 11:09,