Periodically questions are posted where the OP uses a property in its getter/setter which leads to recursive calls and as a result toresults in StackOverflowException
. The most recent one is herehere.
How toshould we handle such questions?
In my opinion, these are typos and have to be closed: instead of typing the backing field name, the OP has typed the property name. I guess every programmer has to face this error once, some. Some of them (those hopeless kind) will ask a question on SOStack Overflow, and it means there will be hunderedshundreds of such questions, not linked, not shown as relevant, etc.
Closing a question as duplicate is an option too. We have cannonical duplicate for NullReferenceExceptiona canonical duplicate for NullReferenceException), but I am unable to find one for StackOverflowException
.
Yet, every such question (at least from my experience) receive thereceives an answer, which in my opinion is wrong.