Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Two structural shapes were added after the decisions above, both following the c

**Closed generic registrations.** A Roslyn source generator is syntax-driven and cannot reify an open generic type, so a generic `[AkkaSerializable]` type (e.g. `Wrapper<T>`) is never itself serialized — the open definition exists only to host the `[AkkaField]` schema its closed constructions share. `[AkkaSerializable<Wrapper<IOrder>>(Manifest = ...)]`, applied to the `[AkkaSerializer]` class, registers one closed construction; each registration then behaves exactly like an ordinary top-level message, with its own manifest and dispatch arm, and its generic fields resolved against the concrete type arguments. A generic definition that implements the serializer's protocol interface with no registered closed construction fails compilation (`AKKASG022`), and a field typed as an unregistered closed construction fails compilation (`AKKASG023`) — the source-generation analog of System.Text.Json rejecting an unbound generic in `[JsonSerializable]`.

Both features are scoped to the current compilation, the same rule every other generator lookup follows (see the cross-assembly discussion in Decision 8): a union member type or a closed-generic registration declared only in a referenced assembly is invisible to this generator.
Scope differs between the two features, and `CrossAssemblyBaselineSpec` pins the current behavior. A union member type declared only in a referenced assembly is invisible to this generator. It fails AKKASG015 even when it carries `[AkkaSerializable]` and a manifest in that assembly. A closed-generic registration is not scoped that way. `[AkkaSerializable<T>]` resolves the generic definition through symbol APIs, not through the per-compilation syntax registry that backs the union check. So a closed construction over a generic definition that lives only in a referenced assembly (`Wrapper<T>` in A, `[AkkaSerializable<Wrapper<int>>]` on B's serializer) compiles and generates correctly today. What fails across assemblies is a non-generic `[AkkaSerializable]` type used as a nested field, and a union member declared in a referenced assembly. Before this branch the nested-field case was misreported as AKKASG023 (unregistered closed generic). It now reports AKKASG007, and both diagnostics name the type, its assembly, and the fixes that work today.

### 14. Always-Explicit Serializer Identity

Expand Down
Loading
Loading