Skip to content

Language Reference: Document null forgiveness operator (!) #13420

Description

@BillWagner

This should be done consistent with the consolidation of existing operators. Consider member access operators? Or the nullable conditional operators?

Activity

  1. added this to the August 2019 milestone on Jul 16, 2019
  2. pkulikov commented on Jul 16, 2019

    @pkulikov
    Contributor

    Consider member access operators? Or the nullable conditional operators?

    @BillWagner if by the "nullable conditional operators" you mean the ?. and ?[] operators, then those are in one overview with the member access operators:
    https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators

    So, the null-forgiveness operator either goes to that overview OR to the separate, its own page. As far as I understand, one can use the ! operator not only when "member-accessing".

  3. self-assigned this
    on Sep 3, 2019
  4. BillWagner commented on Sep 29, 2019

    @BillWagner
    MemberAuthor

    #14727 does mention the ! operator, but doesn't completely address it. I'm reopening this issue.

    I think this should be a separate page in the operators section. I'd put it after ?. and ??= in the TOC. Per the comment on #14727:

    it's not only about member access and more about declaration rather than operation (as far as I understand, x and x! generate the same code at the end?)

    That's correct, there's no runtime difference between x and x!. It's only going to affect static analysis. (One implication of that fact is that null! is legal, and sometimes the right solution).

  5. BillWagner commented on Sep 29, 2019

    @BillWagner
    MemberAuthor

    Interesting GitHub side effect. The phrase "I'd be happy to fix #nnnn" appears to have triggered the closing of this issue.

  6. pkulikov commented on Sep 30, 2019

    @pkulikov
    Contributor

    I think this should be a separate page in the operators section. I'd put it after ?. and ??= in the TOC.

    @BillWagner thanks for the reply. Let it be a separate page. I can work on this next week. If it's fine with you, please assign this issue to me.

    Interesting GitHub side effect. The phrase "I'd be happy to fix #nnnn" appears to have triggered the closing of this issue.

    Indeed, next time I will be more careful with the word "fix" :)

  7. mairaw commented on Sep 30, 2019

    @mairaw
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions