Partial fix/workaround for #489: add `TypeFactory.clearCache()`