更新时间:2022-06-15 08:55:24
您不应该;我希望你有这样的:
You shouldn't; I expect you have something like:
private static int foo;
public static int Foo {
get {return foo;}
set {Foo = value;} // spot the typo!!! (should be foo)
}
从本质上讲,设置
是:
static void set_Foo(int value) {
set_Foo(value);
}
,所以这是递归的,并且最终会消耗堆栈向上(假定没有***化,等等)。
so this is recursive, and will eventually consume up the stack (assuming no optimisations, etc).
这是不可能的诊断多无一code样本。
It is impossible to diagnose more without a code sample.