Skip to content

[10.x] fix(codegen): diagnose inaccessible compound-alias targets before metadata emission - #11607

Open
ReubenBond wants to merge 1 commit into
dotnet:10.xfrom
ReubenBond:rb-compound-alias-backport
Open

ReubenBond wants to merge 1 commit into
dotnet:10.xfrom
ReubenBond:rb-compound-alias-backport

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Backports #11578 to 10.x, including its final review corrections from df5281e2e23cb6adc1dddc359c6ce1d13fb05b27.

Microsoft.Orleans.CodeGenerator 10.4.0 reproduces #11523: the issue's Payload / ITag<T> / private Hidden source emits config.CompoundTypeAliases.Add("required-private-alias", typeof(global::Payload.Hidden)); and fails with CS0122 in the generated metadata file. The serializer-context declaration uses APIs absent from 10.4.0; removing only that declaration isolates the released generator defect.

The generator now reports ORLEANS0116 at an inaccessible compound-alias attribute and emits metadata for accessible target/key types, including friend-accessible internals and open-generic keys. Diagnostic caching preserves current source-tree identity and spans after edits. Metadata diagnostics follow implementation-output gating.

This is one attributed, combined cherry-pick of 40f4b5b7d1, 389b9fbce1, eb17247f9f, 2b46165f65, and df5281e2e2. Necessary maintenance-branch adaptations retain the existing single-attribute extraction signature, reserve the same diagnostic identifier, and place applicable regressions in standalone CompoundTypeAliasTests because 10.x has no serializer-context APIs. The backport includes focused accessibility, friend-assembly, open-generic, implementation-output, and incremental-edit regressions.

Microsoft Reviewers: Open in CodeFlow

…ore metadata emission

Backport dotnet#11578, including the final open-generic-key and diagnostic-location review corrections. Confirmed Microsoft.Orleans.CodeGenerator 10.4.0 emits inaccessible Payload.Hidden metadata for the dotnet#11523 reproduction.

Retain the 10.x single-attribute extraction API and move applicable regressions to standalone CompoundTypeAliasTests, since serializer contexts are absent on this maintenance branch.

(cherry picked from commit 40f4b5b)

(cherry picked from commit 389b9fb)

(cherry picked from commit eb17247)

(cherry picked from commit 2b46165)

(cherry picked from commit df5281e)

Co-authored-by: Reuben Bond <reuben.bond@gmail.com>

This branch has not been deployed

No deployments
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.

2 participants