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:
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
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
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:
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
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 =
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,