Skip to content

Add Unicode out-of-range example to CS1009 compiler error documentation #47963

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

Merged
merged 2 commits into from
Aug 23, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 14, 2025

This PR adds a missing example to the CS1009 compiler error documentation that demonstrates when a well-formed Unicode escape sequence represents an out-of-range value.

The new example shows:

// CS1009; Unicode code points above U+10FFFF are invalid (well-formed but out of range)
string outOfRangeUnicode = "\U00110000";

The Unicode escape sequence \U00110000 is syntactically correct (8 hexadecimal digits as required), but it represents the code point U+110000, which is above the valid Unicode range limit of U+10FFFF. This causes CS1009 even though the escape sequence format is well-formed.

This addition provides developers with a complete understanding of the different scenarios that can trigger CS1009, including syntax errors in escape sequences and semantically invalid Unicode values.

Fixes #40741.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-messages/cs1009.md docs/csharp/language-reference/compiler-messages/cs1009

Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copy link
Contributor

PoliCheck Scan Report

The following reports lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a comment that you post to the PR. The feedback helps reduce false positive instances in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@Copilot Copilot AI changed the title [WIP] An extra reason to get error CS1009 Add Unicode out-of-range example to CS1009 compiler error documentation Aug 14, 2025
@Copilot Copilot AI requested a review from BillWagner August 14, 2025 13:00
Copilot finished work on behalf of BillWagner August 14, 2025 13:00
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This is ready.

@BillWagner BillWagner marked this pull request as ready for review August 15, 2025 14:36
@BillWagner BillWagner requested a review from a team as a code owner August 15, 2025 14:36
@BillWagner BillWagner requested a review from adegeo August 15, 2025 14:36
@BillWagner BillWagner merged commit a6cb496 into main Aug 23, 2025
15 checks passed
@BillWagner BillWagner deleted the copilot/fix-40741 branch August 23, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An extra reason to get error CS1009
3 participants