let types: [Animal.Type] = [Cat.self, Cat.self, Dog.self] print(types.reduce(into: [:]) { (d, x) in d[ObjectIdentifier(x)] = x })