If the complex type extends another complex type and the parent is defined after the child, this will ignore the extension, causing the class not work when used.

Technically speaking, the problem happens because the `findType` looks the loaded types and here is the method that load the types. So it is kind of concurrency problem.
A possible solution would be change the `setBaseType` to accept string instead of object (:-1:) or refactor the method to set the base type after load all types (:+1:).