score:0

Accepted answer

Typical type erasure problem (Map is invariant by Key and real type of Key is erased in extractor). Just use type definition in extractor:

case TrieNode(value, subTrie : Map[T, Trie[T, V]]) => new TrieNode(update(value), subTrie.updated(x, addWith(xs1, subTrie.getOrElse(x, EmptyTrie), update, default)))

Related Query

More Query from same tag