protected function getOrCreateType(Index $index, $typeName)
    {
        Assertion::minLength($typeName, 1, 'Type name must be at least one char long');

        if (!empty($this->types[$index->getName()][$typeName])) {
            return $this->types[$index->getName()][$typeName];
        }

        if (!$this->typeExists($index, $typeName)) {
            $this->createType($index, $typeName);
        }

        return $this->types[$index->getName()][$typeName] = $index->getType($typeName);
    }