fix bug when parsing nested types in namespaces