Skip to content

Preserve gsgen compilation-unit attributes - #2824

Merged
DavidObando merged 1 commit into
mainfrom
fix/issue-2815
Jul 28, 2026
Merged

Preserve gsgen compilation-unit attributes#2824
DavidObando merged 1 commit into
mainfrom
fix/issue-2815

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • translate C# compilation-unit assembly and module attribute lists into G# file-level annotations
  • emit .g.gs output for attribute-only generated or foreign C# documents
  • bind and emit G# @module: annotations, while preventing duplicate file attributes in namespace-split output and syntax traversal

Tests

  • dotnet test tools/gsgen/GSharp.GeneratorHost.Tests/GSharp.GeneratorHost.Tests.csproj --no-restore (31 passed)
  • dotnet test test/Core.Tests/Core.Tests.csproj --no-restore (6765 passed, 1 skipped)
  • dotnet build src/Compiler/Compiler.csproj -c Release --no-restore && dotnet test tools/cs2gs/Cs2Gs.Tests/Cs2Gs.Tests.csproj --no-build --no-restore (1788 passed)

Fixes #2815

@DavidObando
DavidObando merged commit a6c819c into main Jul 28, 2026
10 checks passed
@DavidObando
DavidObando deleted the fix/issue-2815 branch July 28, 2026 04:11
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.

gsgen: back-translation drops compilation-unit-level [assembly:] attributes and emits nothing for type-free files

1 participant