Beef icon indicating copy to clipboard operation
Beef copied to clipboard

type resolution is hitting an infinite recursion

Open ZeHasNoName opened this issue 6 months ago • 0 comments

In a C# project I use the Curiously Recurring Template Pattern (CRTP) and go two layers deep with it:

class A<TFinal> where TFinal : A<TFinal> { }

class B<TFinal> : A<TFinal> where TFinal : B<TFinal> { }

class C : B<C> { }

I tried to do the same in beef. And while one layer deep works fine:

class A<TFinal> where TFinal : Self { }

class B : A<Self> { }

With two layers it doesn't compile:

class A<TFinal> where TFinal : Self { }

class B<TFinal> : A<TFinal> where TFinal : Self { }

class C : B<Self> { }

Error message says: Stack exhausted in DoPopulateType

Tested with newest nightly 06/15/2025 (764c45).

ZeHasNoName avatar Jun 17 '25 06:06 ZeHasNoName