It probably isn't possible, but I want to check if something like this can be expressed in a simple way:
// obviously doesn't work
class Foo<T> : IFoo<T1,T2>
where T: Bar<T1,T2>
{
// ...
Baz<T1,T2> getBaz(){...}
}
Right now I declare Foo<T1,T2>
, but I don't like it semantically, and the only way to get the constraint is to also list Bar
in Foo
's generic parameter list and I am looking to reduce the redundancy, not add to it.
EDIT: Baz<T1,T2>
should be a return type, not method name