C# generics contraints propagation

后端 未结 5 1340
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-10 06:11

This example is a simplification of the real problem, but how can I get this to compile? I would expect the generics constraints to propagate.

Since T is a TClass and TC

5条回答
  •  情书的邮戳
    2021-02-10 06:35

    I'm not sure if the following is a typo in your code or in your copy/paste alteration (for simplification):

    public void FuncA() where Ta : class //TClass instead of class?
    {
    }
    

提交回复
热议问题