Open
Description
The compiler is complaining about type mismatches, priority.first is returning the element of the node, while key2node is expecting the node:
Cannot assign value of type 'KeyType?' to subscript of type 'LinkedList<KeyType>.LinkedListNode<KeyType>?'
at line [1]
My solution is to change key2node[key] = first
of insert()
[1]
with key2node[key] = priority.node(at: 0)
.
Metadata
Metadata
Assignees
Labels
No labels