Skip to content
Discussion options

You must be logged in to vote

The problem with both the gist and this simpler example is that the compiler has no way to relate the bool returns of the handler to the result of TryParse. For all it knows, one of the AppendX methods could have failed, causing the subsequent ones to never be run. In order to get this (and the gist) to work, you'd have to make them return void, not bool, and have the handler just no-op for subsequent calls: https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQAwAIpwHQCUCuAdgC4CWAtgKbYDCA9uQA6kA2lATgMocBupAxpQDOAbmRpMcAGzoACgEN2Q0oQDmAUQAexSoWV09YpMlIAzdAAoARADl5VEOgBi8/EOIA1ABroAgqspHAGYYK2wAFXYATwUlSgsAElt7QPQAbwBxSmILOnxiSVQAfnRCFIBKAF8/AMdM7Nz89BUC+QCqq3Ly5DTkdH7JAE5rMqpOowH0AHoprGGktNHKSvHpqfQ…

Replies: 1 comment 1 reply

Comment options

@FaustVX
Comment options

Answer selected by FaustVX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants