Metadata needs to support two distinct code generation paths: generating the usual FreeBuilder superclass; and generating a stub for the user to extend. This means Metadata needs to mark its Builder property as nullable, obfuscating what data is available where in the code. Instead, move responsibility for choosing a code generator to Analyser, and move stub code generation into a new GeneratedStub type.
Metadata needs to support two distinct code generation paths: generating the usual FreeBuilder superclass; and generating a stub for the user to extend. This means Metadata needs to mark its Builder property as nullable, obfuscating what data is available where in the code. Instead, move responsibility for choosing a code generator to Analyser, and move stub code generation into a new GeneratedStub type.