J
Jazer
I have a couple of classes that implement an interface with a generic
method:
interface IMyInterface {
string Name { get; set; };
T DoSomething<T>();
}
abstract class BaseDoingSomething : IMyInterface {
private string _name = "My Name";
public string Name {
get { return _name; }
set { _name = value; }
}
public abstract T DoSomething<T>();
}
class MyDoingSomething : BaseDoingSomething {
public override IList<string> DoSomething<IList<string>>()
{
// do something that results in a IList<string>
return myListOfString;
}
}
this results in the CS0081: type parameter declaration must be an
identifier not a type
I thought this was a valid use of compile-time typing. No?
Thanks!
B.
method:
interface IMyInterface {
string Name { get; set; };
T DoSomething<T>();
}
abstract class BaseDoingSomething : IMyInterface {
private string _name = "My Name";
public string Name {
get { return _name; }
set { _name = value; }
}
public abstract T DoSomething<T>();
}
class MyDoingSomething : BaseDoingSomething {
public override IList<string> DoSomething<IList<string>>()
{
// do something that results in a IList<string>
return myListOfString;
}
}
this results in the CS0081: type parameter declaration must be an
identifier not a type
I thought this was a valid use of compile-time typing. No?
Thanks!
B.