This doesn’t work if `DataStructureKit` and `BinarySearchTree` have the same 
name.

> > public struct BinarySearchTree<Key: Comparable, Value>{
> > typealias Node = Node<Key, Value>
> > var root: Node?
> > }
> > 
> > private class Node<Key: Comparable, Value>{ }
> > 
> > This code currently doesn’t compile because the Node typealias circularly 
> > references itself. I’d like this syntax to just work, because this are the 
> > alternatives:
> > - rename the typealias to something like `TheNode`
> > - rename the Node class
> > - don’t use a typealias at all
> - fully qualify the class name with the name of the module:
> 
> typealias Node = DataStructureKit.Node<Key, Value>
> 
> --
> Brent Royal-Gordon
> Architechies
> 
> 
> 
> 
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to