Skip to content

How can I check null! or null in property initializer? #51358

Discussion options

You must be logged in to vote

The expression for Property2 will be wrapped in a SuppressNullableWarningExpression, whereas Property3 will not.

SharpLab has a nice visualization of the syntax tree:

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@KyouyamaKazusa0805
Comment options

@PathogenDavid
Comment options

@PathogenDavid
Comment options

Answer selected by KyouyamaKazusa0805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants