Support code generation for external libraries
Support nested types