A
Anthony Jones
Why would it be invalid? All it's saying that the close type of
instance is required to be class, inherit from Stream and have
parameterless constructor.
where T: class states this about T; "Can be any class", it _doesn't_ state
"Can't be a struct" or "must at least be a class".
where T: Stream states this about T; "Must be a Stream".
Thus where T: class, Stream states this about T;
"Can be any class" and "Must be a Stream". Clearly this is contradition,
since not all classes are Streams.
Then it is a totally different beast. In this case, Stream indicates
that it has to be class Stream, and not any class. Then why
where T:class, ISomeInterface is allowed?
Agreed. The contradiction argument doesn't hold just thought it might help.
The truth is wot Marc says, the list of contraints can contain only one
primary constraint class, struct or a specific type. The reason this
restriction is there is that anything else would be pointless due to it
being redundant.