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

Nullable annotations part 1 #2253

Merged
merged 4 commits into from
Sep 3, 2021
Merged

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Sep 2, 2021

Enable nullable annotations for LinkContext and the XML processing classes. I chose these as a starting point for no reason in particular, except that they produced a lot of warnings. Also includes other small fixes for things I noticed. In particular PTAL at the removed ReportUnresolved calls in LinkContext.Resolve - those looked like they were producing redundant warnings for cached null results.

Enable nullable annotations for LinkContext and the XML processing classes.
@sbomer sbomer requested a review from marek-safar as a code owner September 2, 2021 21:24
@sbomer sbomer requested a review from vitek-karas September 2, 2021 21:24
- Use null check instead of assert
- Add NotNullWhen annotation
@sbomer sbomer merged commit 39505a8 into dotnet:main Sep 3, 2021
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* Nullable annotations part 1

Enable nullable annotations for LinkContext and the XML processing classes.


Commit migrated from dotnet/linker@39505a8
sbomer added a commit to dotnet/runtime that referenced this pull request Jun 19, 2024
The resolution cache is shared between `Resolve` and
`TryResolve`, so we should call `ReportUnresolved` from `Resolve`
when we see a cached null result (that could have been cached
during `TryResolve`). Should make no difference to supported
scenarios because we always run with `IgnoreUnresolved` `true`.

This was regressed in
dotnet/linker#2253.

---------

Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants