ReSharper 2016.2 Help

Code Inspection: Possible infinite inheritance

In a situation similar to the following:

class B<U> { } class A<T> : B<A<A<T>>> { }

You effectively end up with the type A<T> that inherits an infinitely recursive type B. As a result, your assembly will compile, but you will be unable to execute it. If you try, you will get an error message similar to the following:

Could not load type ‘ConsoleApplication1.A{{1' from assembly 'ConsoleApplication1, Version=, Culture=neutral, PublicKeyToken=null' because it has recursive generic definition.

See Also

Last modified: 15 December 2016