B
Brad Wood
I have this method declaration:
private SomeType getSomething<T>( T spec ) where T: String, MemoryStream
The compiler error I get is:
'string' is not a valid constraint. A type used as a constraint must be
an interface, a non-sealed class or a type parameter.
I don't understand what is meant by "type parameter" in this context. I
understand a "type parameter" to be my "T" so I don't understand how a
constraint can be the same thing...
private SomeType getSomething<T>( T spec ) where T: String, MemoryStream
The compiler error I get is:
'string' is not a valid constraint. A type used as a constraint must be
an interface, a non-sealed class or a type parameter.
I don't understand what is meant by "type parameter" in this context. I
understand a "type parameter" to be my "T" so I don't understand how a
constraint can be the same thing...