Allow 'where' class restrictions on the Generic Parameters of Generic Classes #4286
Unanswered
Joseph-Melberg
asked this question in
General
Replies: 1 comment 1 reply
-
This could be a part of HKT(#339). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Given
public class A : B<ImplParam> {}
public class ImpleParam : Param {}
public abstract class Param {}
public abstract class B<T> where T : Param {}
I would like to be able to restrict the method
public void Foo<TClass>()
let TParameter : Param
where TClass : B<TParameter>
{}
The current work around is
public void Foo<TClass,TParameter>() where TClass : B<TParameter> where TParameter : Param {}
Would it be possible to incorporate this feature?
Beta Was this translation helpful? Give feedback.
All reactions