H
Harold Howe
Is it possible to override a specific instance of a virtual, generic
method? IE:
using System;
class Base
{
public virtual void Test<U>(U u)
{
Console.WriteLine("Base.Test {0}, u);
}
}
class Derived : Base
{
public override Test(string u)
{
Console.WriteLine("Derived.Test {0}, u);
}
}
This generates a compiler error (No suitable method to override). This
would be slick as heck, but it boils down to a form of specialization,
which I don't think is allowed.
H^2
method? IE:
using System;
class Base
{
public virtual void Test<U>(U u)
{
Console.WriteLine("Base.Test {0}, u);
}
}
class Derived : Base
{
public override Test(string u)
{
Console.WriteLine("Derived.Test {0}, u);
}
}
This generates a compiler error (No suitable method to override). This
would be slick as heck, but it boils down to a form of specialization,
which I don't think is allowed.
H^2