Skip to content

Fix misplaced #nullable enable in Maps PublicAPI.Unshipped.txt files#34320

Merged
jfversluis merged 1 commit intonet11.0from
fix/maps-publicapi-nullable-placement
Mar 4, 2026
Merged

Fix misplaced #nullable enable in Maps PublicAPI.Unshipped.txt files#34320
jfversluis merged 1 commit intonet11.0from
fix/maps-publicapi-nullable-placement

Conversation

@StephaneDelcroix
Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description

The BOM-prefixed #nullable enable line in 14 Maps PublicAPI.Unshipped.txt files was at the bottom of the file instead of line 1, causing RS0017 analyzer errors:

Symbol '#nullable enable' is part of the declared API, but is either not public or could not be found

This was likely caused by a prior sort operation that treated the BOM byte as a regular character, sorting the line after all API entries.

Changes

Moved #nullable enable back to line 1 (with BOM) in all 14 affected files:

  • 7 files in src/Core/maps/src/PublicAPI/
  • 7 files in src/Controls/Maps/src/PublicAPI/

The BOM-prefixed #nullable enable line was sorted to the bottom of 14
Maps PublicAPI.Unshipped.txt files instead of remaining at line 1,
causing RS0017 analyzer errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 4, 2026 07:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34320

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34320"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes RS0017 PublicApiAnalyzer errors in .NET MAUI Maps by ensuring the #nullable enable directive (with BOM) is the first line in affected PublicAPI.Unshipped.txt files, so it’s parsed as a directive rather than a declared API symbol.

Changes:

  • Moved the BOM-prefixed #nullable enable line to line 1 in Maps PublicAPI.Unshipped.txt files across multiple TFMs.
  • Removed the misplaced trailing #nullable enable entries (and the non-BOM variant where applicable).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Core/maps/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Core/maps/src/PublicAPI/net/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Core/maps/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Core/maps/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Core/maps/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Core/maps/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Core/maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Controls/Maps/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Controls/Maps/src/PublicAPI/net/PublicAPI.Unshipped.txt Moves #nullable enable (with BOM) to the first line; removes trailing misplaced directive.
src/Controls/Maps/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Controls/Maps/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Controls/Maps/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Controls/Maps/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.
src/Controls/Maps/src/PublicAPI/net-android/PublicAPI.Unshipped.txt Ensures first-line BOM #nullable enable; removes the non-BOM directive line.

@StephaneDelcroix
Copy link
Copy Markdown
Contributor Author

/azp run maui-pr-devicetests, maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

jfversluis added a commit that referenced this pull request Mar 4, 2026
The prior agent session used LC_ALL=C sort to resolve merge conflicts
in PublicAPI.Unshipped.txt files, which pushed the BOM-prefixed
#nullable enable line to the bottom. This caused RS0017 analyzer errors
fixed by PR #34320.

Add explicit guidance to prevent this: explain why plain sort breaks
these files and provide a safe conflict resolution script.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jfversluis added a commit that referenced this pull request Mar 4, 2026
The prior agent session used LC_ALL=C sort to resolve merge conflicts
in PublicAPI.Unshipped.txt files, which pushed the BOM-prefixed
#nullable enable line to the bottom. This caused RS0017 analyzer errors
fixed by PR #34320.

Add explicit guidance to prevent this: explain why plain sort breaks
these files and provide a safe conflict resolution script.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis
Copy link
Copy Markdown
Member

Test failures unrelated

@jfversluis jfversluis merged commit 6b9b9ea into net11.0 Mar 4, 2026
121 of 213 checks passed
@jfversluis jfversluis deleted the fix/maps-publicapi-nullable-placement branch March 4, 2026 12:46
jfversluis added a commit that referenced this pull request Mar 5, 2026
…34327)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

PR #34320 fixed RS0017 analyzer errors caused by `#nullable enable`
being sorted to the bottom of 14 Maps `PublicAPI.Unshipped.txt` files.
The root cause was a prior Copilot agent session that used `LC_ALL=C
sort -u` to resolve merge conflicts — the BOM bytes (`0xEF 0xBB 0xBF`)
sort after all ASCII characters, pushing the directive below the API
entries.

This updates the Copilot instructions to prevent this from recurring:

- Explains that `#nullable enable` must remain on line 1
- Warns against using plain `sort` on these files (BOM sort ordering)
- Provides a safe conflict resolution script that preserves the header
before sorting API entries

Co-authored-by: Copilot <223556219+Copilot@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.

5 participants