It may not be appropriate. For example, consider:
class Other : Bar {}
...
IDo<Other> do = new DoImpl<Other>();
Foo<Other> foo = new Foo<Other>();
foo.Add2(do);
With your current code, that would be calling do.Add2(new Bar())
... which is clearly invalid as a Bar
isn't an Other
, required by IDo<Other>.Stuff
.
Casting to T
(or using as
) isn't appropriate either - you can't cast a new Bar()
to Other
, and if you use as
you'll just get a null reference.