I\'m trying to use Károly Lőrentey\'s B-tree based OrderedSet in a project. However, I\'m running into an issue where I can\'t declare an unqualified OrderedSet
The type can be disambiguated using the little-known import (class|struct|func|protocol|enum) Module.Symbol
syntax.
import struct BTree.OrderedSet
From this point on, OrderedSet unambiguously refers to the one in BTree.
If this would still be ambiguous or sub-optimal in some files, you can create a Swift file to rename imports using typealiases:
// a.swift
import struct BTree.OrderedSet
typealias BTreeOrderedSet = BTree.OrderedSet
// b.swift
let foo = OrderedSet() // from Foundation
let bar = BTreeOrderedSet() // from BTree
There was a new syntax discussed for Swift 3, but it fell through.