basarat/typescript-collections

Compilation error on TS0.9.5.0

Closed this issue · 3 comments

I found to issues when compiling on TS0.9.5.0:

collections.ts(1511,13): error TS2012: Cannot convert 'LinkedList<{}>' to 'LinkedList<T>': Types of property 'firstNode' of types 'LinkedList<{}>' and 'LinkedList<T>' are incompatible: Types of property 'element' of types 'ILinkedListNode<{}>' and 'ILinkedListNode<T>' are incompatible.
collections.ts(2410,17): error TS2012: Cannot convert '{}' to 'BSTreeNode<T>': Type '{}' is missing property 'element' from type 'BSTreeNode<T>'.

Making the following corrections seems to sort it out:

Line 1511 changed to "this.list = new LinkedList();"
Line 2405 changed to "var queue = new Queue<BSTreeNode>();"

Hope this comment helps others and that you get these or other corrections done in the code so it compiles. Let me know if I can be of any assistance.

I PRd to fix this and similar issues.

Thanks :)

I changed
Line 1511 to this.list = new LinkedList();

Line 2411 to node = <BSTreeNode> queue.dequeue();