Skip to content

Lower-case the drop-in accessibility with the invariant culture - #277

Open
menes97 wants to merge 1 commit into
Cysharp:mainfrom
menes97:fix/dropin-invariant-accessibility
Open

menes97 wants to merge 1 commit into
Cysharp:mainfrom
menes97:fix/dropin-invariant-accessibility

Conversation

@menes97

@menes97 menes97 commented Nov 16, 2026

Copy link
Copy Markdown

DropInGenerator builds the class modifier from extension.Accessibility.ToString().ToLower(). ToLower() uses the current culture, and in the Turkish and Azerbaijani cultures "I".ToLower() is "ı" (dotless i). Source generators run inside the compiler with the build machine's culture, so on such a machine a [ZLinqDropInExtension] on an internal type generates

ınternal static partial class GlobalListVIZLinqDropInExtensions

which fails with CS1585. ProtectedAndInternal/ProtectedOrInternal are affected the same way.

The fix uses ToLowerInvariant(); other cultures get the same output as before.

How I checked it (there is no generator test project, so I used the sandbox): on a Windows machine with the tr-TR culture, dotnet build sandbox/ConsoleApp fails with CS1585 in ZLinq.DropIn.GlobalListVIExtensions.g.cs (its GlobalListVI is internal), and the emitted file starts with ınternal. With the change it builds and the file starts with internal.

The change was found and written with Claude Code (AI assistance); I reviewed and verified it.

🤖 Generated with Claude Code

The DropInGenerator turned the type's Accessibility into the C# keyword
with ToLower(), which uses the current culture. On a machine with the
Turkish or Azerbaijani culture "Internal" became "ınternal", and a
[ZLinqDropInExtension] on an internal type produced code that failed to
compile (CS1585).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

1 participant