Skip to content

Address remaining nullable reference type issues#1515

Merged
BillWagner merged 4 commits intodotnet:draft-v8from
BillWagner:nullable-cleanup
Jan 14, 2026
Merged

Address remaining nullable reference type issues#1515
BillWagner merged 4 commits intodotnet:draft-v8from
BillWagner:nullable-cleanup

Conversation

@BillWagner
Copy link
Member

Fixes #1228

  • For item 2: Add that a lifted conversion may return a null reference type, which can then be converted to a non-nullable reference type, which generates a warnings.
  • For item 3 & 4: Add bullet points for the default (and default(T)) expression, and the null literal expression.

@BillWagner BillWagner added the meeting: priority Review before meeting. Merge, merge with issues, or reject at the next TC49-TC2 meeting label Dec 19, 2025
Co-authored-by: Joseph Musser <me@jnm2.com>
Co-authored-by: Joseph Musser <me@jnm2.com>
- Maybe null when its declaration is in text where the annotations flag is enabled.
- Not null when its declaration is in text where the annotations flag is disabled.
- The default null state of a non-nullable reference type is not null.
- The default state of the `null` literal (§6.4.5.7) is maybe null.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RexJaeschke Please file an issue (assign it to me) for expressions without types, referring to this PR.

@BillWagner BillWagner merged commit 1f1f812 into dotnet:draft-v8 Jan 14, 2026
6 checks passed
@BillWagner BillWagner deleted the nullable-cleanup branch January 14, 2026 20:51
BillWagner added a commit that referenced this pull request Jan 16, 2026
* Bump Microsoft.NET.Test.Sdk and 2 others (#1526)

Bumps Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1
Bumps Newtonsoft.Json from 13.0.3 to 13.0.4
Bumps xunit.runner.visualstudio from 3.1.4 to 3.1.5

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-version: 18.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dotnet
- dependency-name: Newtonsoft.Json
  dependency-version: 13.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dotnet
- dependency-name: xunit.runner.visualstudio
  dependency-version: 3.1.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dotnet
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump Microsoft.NET.Test.Sdk, NUnit.Analyzers and NUnit3TestAdapter (#1525)

Bumps Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1
Bumps NUnit.Analyzers from 4.10.0 to 4.11.2
Bumps NUnit3TestAdapter from 5.1.0 to 6.0.1

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-version: 18.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dotnet
- dependency-name: NUnit.Analyzers
  dependency-version: 4.11.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dotnet
- dependency-name: NUnit3TestAdapter
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dotnet
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Address remaining nullable reference type issues (#1515)

* Warning on lifted conversion w/ null

Fixes item 2 in #1228

* Specify default null state of default

Fixes the 3rd and 4th item in the list.

* Update standard/types.md

Co-authored-by: Joseph Musser <me@jnm2.com>

* Apply suggestions from code review

Co-authored-by: Joseph Musser <me@jnm2.com>

---------

Co-authored-by: Joseph Musser <me@jnm2.com>

* [create-pull-request] automated change (#1531)

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>

* Add an exception to the requirement that partial method declarations have the same modifiers (#1521)

* Add an exception to the requirement that partial method declarations have the same modifiers

* Update standard/classes.md

---------

Co-authored-by: Jon Skeet <jonskeet@google.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joseph Musser <me@jnm2.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Co-authored-by: Jon Skeet <jonskeet@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meeting: priority Review before meeting. Merge, merge with issues, or reject at the next TC49-TC2 meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nullable Spec Issue List

4 participants