Skip to content

Review usage of nullable suppressions (especially !) in CodeExporter.cs  #78704

Closed

Description

@ViktorHofer

#78703 adds a couple of nullable suppressions that should be removed and cleaned-up. Those suppressions are necessary as previously, the assembly compiled against ref/System.CodeDom but with the above PR now binds against src/System.CodeDom which has a different nullability setting.

Activity

  1. added this to the 8.0.0 milestone on Nov 22, 2022
  2. halgab commented on Aug 5, 2023

    @halgab
    Contributor

    Winforms repo has problems as well with the current state of nullability annotations in System.CodeDom. We bumped into the same problems with CodeFieldReferenceExpression, CodePrimitiveExpression and CodePropertyReferenceExpression. See dotnet/winforms#9663

  3. modified the milestones: 8.0.0, 9.0.0 on May 23, 2024
  4. modified the milestones: 9.0.0, 10.0.0 on Dec 9, 2024
  5. added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 11, 2025
  6. modified the milestones: 10.0.0, 11.0.0 on Sep 22, 2025
  7. StephenMolloy commented on Apr 27, 2026

    @StephenMolloy
    Contributor

    None of these suppressions are dangerous. The TypeReference! ones are genuinely non-null. The CodeDom API ones (null!) are correct usage that happens to conflict with CodeDom's lack of nullable annotations.

    I'm still adding a PR to add some more Asserts and null-suppression cleanup for this file.

  8. added a commit that references this issue on Jun 4, 2026
    d2b5550
  9. locked and limited conversation to collaborators on Jul 5, 2026
  10. added a commit that references this issue on Jul 15, 2026
    71e8c9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Serializationin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions