JetBrains Rider 2026.1 Help

代码检查:可能的循环构造函数调用

给出以下(相当合成的)代码片段

class Base { Base(int n) : this("") { } Base (string s) : this(0) { } }

调用任何一个构造函数都会导致最终的堆栈溢出,因为构造函数会不断地相互调用。

2026年 3月 25日