Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LRUCache does not compile with newer Swift #964

Open
rainbowcardiod opened this issue Feb 22, 2021 · 0 comments
Open

LRUCache does not compile with newer Swift #964

rainbowcardiod opened this issue Feb 22, 2021 · 0 comments

Comments

@rainbowcardiod
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant