Skip to content

fix: honor NotNull and DisallowNull nullability attributes#2334

Merged
latonz merged 1 commit into
riok:mainfrom
latonz:feat/notnull-disallownull-attributes
Jun 22, 2026
Merged

fix: honor NotNull and DisallowNull nullability attributes#2334
latonz merged 1 commit into
riok:mainfrom
latonz:feat/notnull-disallownull-attributes

Conversation

@latonz

@latonz latonz commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Already honored MaybeNull (read) and AllowNull (write) to widen a non-nullable typed member to nullable. Add the symmetric narrowing:

  • NotNull on a nullable-typed source member treats the read value as non-nullable, so no null guard is emitted.
  • DisallowNull on a nullable-typed target member treats the write as non-nullable, so a null source is guarded/skipped.

Already honored MaybeNull (read) and AllowNull (write) to widen a
non-nullable typed member to nullable. Add the symmetric narrowing:

- NotNull on a nullable-typed source member treats the read value as
  non-nullable, so no null guard is emitted.
- DisallowNull on a nullable-typed target member treats the write as
  non-nullable, so a null source is guarded/skipped.
@latonz latonz self-assigned this Jun 22, 2026
@latonz latonz added the bug Something isn't working label Jun 22, 2026
@latonz latonz changed the title feat: honor NotNull and DisallowNull nullability attributes fix: honor NotNull and DisallowNull nullability attributes Jun 22, 2026
@latonz
latonz merged commit dd44ee9 into riok:main Jun 22, 2026
17 of 18 checks passed
@latonz
latonz deleted the feat/notnull-disallownull-attributes branch June 22, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant