Skip to content

Conditional suppression of CS8618 #72717

Closed Answered by CyrusNajmabadi
fiseni asked this question in Q&A
Discussion options

You must be logged in to vote

You either have to use pragma

That seems like a very good thing. Use of this constructor would leave the object in an invalid state, and you need to add additional information to indicate that that is ok, because there is external domain knowledge being used to know it is being properly initialized.

Note: you could always create a DiagnosticSuppressor for these cases, since you have the info on whether or not this is actually safe.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by CyrusNajmabadi
Comment options

You must be logged in to vote
2 replies
@CyrusNajmabadi
Comment options

@fiseni
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
Category
Q&A
Labels
None yet
2 participants