fix cache bug on DictType.all_types