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

simple terms please- what do i do about it #34522

Closed
edthehorse opened this issue Mar 13, 2023 · 5 comments · Fixed by #44978
Closed

simple terms please- what do i do about it #34522

edthehorse opened this issue Mar 13, 2023 · 5 comments · Fixed by #44978
Assignees
Labels
dotnet-csharp/svc errors-warnings/subsvc in-pr This issue will be closed (fixed) by an active pull request. okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@edthehorse
Copy link

edthehorse commented Mar 13, 2023

[Enter feedback here]


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 368775

@BillWagner
Copy link
Member

Hi @edthehorse

Can you add some details on which terms aren't defined or aren't clear? That will help us resolve this.

@BillWagner BillWagner added the needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution] label Mar 13, 2023
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Mar 13, 2023
@edthehorse
Copy link
Author

edthehorse commented Mar 13, 2023 via email

@github-actions github-actions bot removed the needs-more-info Needs more info from OP. Auto-closed after 2 weeks if no response. [org][resolution] label Mar 13, 2023
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Mar 13, 2023
@edthehorse
Copy link
Author

edthehorse commented Mar 13, 2023 via email

@BillWagner
Copy link
Member

Thanks @edthehorse

That helps a lot.

First, the specific question:

Table1 t1 = new Table1();
t1 = (Table1) serializer.Deserialize(reader);

The Deserialize method could return null. The compiler issues CS8600 if you assign a value that might be null to a variable whose type is not null. Table is a non-nullable reference.

There are two fixes:

  1. Provide a default:
t1 = (Table1)serializer.Deserialize(reader) ?? new Table1();
  1. Add the null-forgiveness operator (!):
t1 = (Table1) serializer.Deserialize(reader)!;

Second, to fix this for other readers that encounter the same situation: I think the overview of Nullable reference types provides the background needed to understand why these warnings get generated. Do you agree? If so, I'll add a link to that article, and recommend it for anyone unfamiliar with the feature.

We want to keep the error pages as brief as possible. People want to understand the error quickly, and get on with their programming! For that reason, I don't want to replicate the entire overview here. If a paragraph introduction would help, I'll add it.

Thanks for the responses to help us make this better for everyone!

@edthehorse
Copy link
Author

edthehorse commented Mar 22, 2023 via email

@BillWagner BillWagner self-assigned this Feb 3, 2025
@BillWagner BillWagner added 🗺️ reQUEST Triggers an issue to be imported into Quest. okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. labels Feb 3, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 3, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 3, 2025
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Feb 4, 2025
@BillWagner BillWagner moved this from 🔖 Ready to 🏗 In progress in dotnet/docs February 2025 sprint project Feb 20, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 20, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 20, 2025
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Feb 20, 2025
@BillWagner BillWagner moved this from 🏗 In progress to 👀 In review in dotnet/docs February 2025 sprint project Feb 20, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 20, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Feb 20, 2025
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in dotnet/docs February 2025 sprint project Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-csharp/svc errors-warnings/subsvc in-pr This issue will be closed (fixed) by an active pull request. okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants