Skip to content

MudSelect: Add nullable annotation.#9937

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
ScarletKuro:select_nullable
Oct 8, 2024
Merged

MudSelect: Add nullable annotation.#9937
ScarletKuro merged 1 commit intoMudBlazor:devfrom
ScarletKuro:select_nullable

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented Oct 8, 2024

Description

Part of this issue #6535

There is an ugly thing:

#nullable disable
protected Dictionary<T, MudSelectItem<T>> _valueLookup = new();
protected Dictionary<T, MudSelectItem<T>> _shadowLookup = new();
#nullable enable

The T of the component can be null, but the key dictionary actually cannot be, so I had to disable the nullable check as it requires the notnull constrain on the T which I cannot do. This is a overall design problem of the component.

How Has This Been Tested?

No tests required.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change, improve null diagnostic warnings)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@ScarletKuro ScarletKuro added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library and removed PR: needs review labels Oct 8, 2024
@codecov
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.85%. Comparing base (28bc599) to head (1f7f031).
Report is 521 commits behind head on dev.

Files with missing lines Patch % Lines
...MudBlazor/Components/Select/MudSelectItem.razor.cs 71.42% 1 Missing and 1 partial ⚠️
src/MudBlazor/Components/Select/MudSelect.razor.cs 95.83% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9937      +/-   ##
==========================================
+ Coverage   89.82%   90.85%   +1.02%     
==========================================
  Files         412      415       +3     
  Lines       11878    12962    +1084     
  Branches     2364     2510     +146     
==========================================
+ Hits        10670    11776    +1106     
+ Misses        681      619      -62     
- Partials      527      567      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro added hacktoberfest Hacktoberfest 2021 hacktoberfest-accepted Issues and PRs which were accepted as Hacktoberfest submissions hacktoberfest2024 labels Oct 8, 2024
@ScarletKuro ScarletKuro merged commit 06df669 into MudBlazor:dev Oct 8, 2024
@ScarletKuro ScarletKuro deleted the select_nullable branch October 8, 2024 12:25
LLauter pushed a commit to cannellamedia/MudBlazor that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library hacktoberfest Hacktoberfest 2021 hacktoberfest2024 hacktoberfest-accepted Issues and PRs which were accepted as Hacktoberfest submissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant