Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nullability error CS8620 in tests #12475

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Fix nullability error CS8620 in tests #12475

merged 2 commits into from
Nov 13, 2024

Conversation

am11
Copy link
Member

@am11 am11 commented Nov 13, 2024

Fix warning (as error):

src\winforms\src\System.Windows.Forms.Design\tests\UnitTests\System\Windows\Forms\Design\ToolStripContentPanelDesignerTests.cs(43,67): error CS8620: (NETCORE_ENGINEERING_TELEMETRY=Build) Argument of type 'string[]' cannot be used for parameter 'span' of type 'Span<string?>' in 'bool MemoryExtensions.Contains<string?>(Span<string?> span, string? value)' due to differences in the nullability of reference types.

This is to unblock dotnet/sdk#44843. I have tested with 10.0.100-alpha.1.24562.4 in global.json, this is the only instance of the error.

Microsoft Reviewers: Open in CodeFlow

@am11 am11 requested a review from a team as a code owner November 13, 2024 19:21
@am11
Copy link
Member Author

am11 commented Nov 13, 2024

cc @ViktorHofer

ViktorHofer
ViktorHofer previously approved these changes Nov 13, 2024
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

Thanks a lot

@ViktorHofer ViktorHofer enabled auto-merge (squash) November 13, 2024 19:45
@am11
Copy link
Member Author

am11 commented Nov 13, 2024

Basically it expects either both operands of Contains be string or string?. Mixing them confuses the new compiler due to the upcoming "first-class span" feature.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.73518%. Comparing base (8d8deef) to head (98c59e0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12475         +/-   ##
===================================================
+ Coverage   75.71428%   75.73518%   +0.02089%     
===================================================
  Files           3152        3153          +1     
  Lines         635711      635797         +86     
  Branches       46970       46973          +3     
===================================================
+ Hits          481324      481522        +198     
+ Misses        150944      150841        -103     
+ Partials        3443        3434          -9     
Flag Coverage Δ
Debug 75.73518% <100.00000%> (+0.02089%) ⬆️
integration 18.27004% <ø> (+0.01766%) ⬆️
production 49.31027% <ø> (+0.03946%) ⬆️
test 97.05103% <100.00000%> (+0.00072%) ⬆️
unit 46.28855% <ø> (+0.03312%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@ViktorHofer ViktorHofer merged commit 8dd924a into dotnet:main Nov 13, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Nov 13, 2024
@am11 am11 deleted the patch-1 branch November 13, 2024 23:55
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants