| Severity | Error |
| Reported by | Metalama.Framework |
| Message | Cannot generate a compile-time serializer for '<Type>' because the base type '<BaseType>' declares several nested types that implement ISerializer. |
Cause
Metalama generates a serializer for each type implementing ICompileTimeSerializable, unless the type declares its own. When the base type is also serializable, the generated serializer derives from the serializer of the base type, which can be a manual serializer: a nested type of the base type that implements ISerializer.
Metalama reports LAMA0209 when it generates the serializer of a type, <Type> in the message, and finds more than one nested serializer in the base type, <BaseType>, so it can't choose the serializer to derive from.
In the current version of Metalama, the base type itself is checked first: Metalama reports LAMA0208 on the base type and stops before generating the serializer of the derived type. For this reason, you normally see LAMA0208 instead of LAMA0209, and this article has no example.
Resolution
Keep a single nested type implementing ISerializer in the base type, as described in LAMA0208. If you don't own the base type, contact its author.