Skip to content

CS0177 weird behavior #69057

Closed Locked Answered by CyrusNajmabadi
levicki asked this question in General
Jul 16, 2023 · 2 comments · 20 replies
Discussion options

You must be logged in to vote

Simplified:

In the first case, there appears to be a non-exceptional codepath where the variable is not assigned. This is because the language doesn't track the relationship between variables, so we don't understand how to use the 'Succeeded' variable to inform things here.

If you want that to be supported, you'll have to make a language changes request.

In the second case, we can see that in all non-exceptional paths it is assigned. And it exceptional paths it isn't(which is 100% ok). This is again working just as spec'ed in the language. There's no indication that there is anything even wrong in this case. This works very much as intended wrt exceptional vs non-exceptional flows. You co…

Replies: 2 comments 20 replies

Comment options

You must be logged in to vote
20 replies
@levicki
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

Answer selected by levicki
@CyrusNajmabadi
Comment options

@CyrusNajmabadi
Comment options

@levicki
Comment options

@CyrusNajmabadi
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants