Does .Net support curried generics?

前端 未结 2 999
予麋鹿
予麋鹿 2021-02-12 19:15

Suppose we have a nested generic class:

public class A {
    public class B { }
}

Here, typeof(A.B<>)<

2条回答
  •  梦谈多话
    2021-02-12 19:46

    Is this what you have in mind?

       class AB
       {
          protected T t;
          U u;
       }
    
       class C : AB
       {
          public void Foo()
          {
             t = 5;
          }
       }
    

提交回复
热议问题