Calling a global function which has the same name as a member function

前端 未结 2 1309
既然无缘
既然无缘 2021-01-03 21:05

The Array type in Swift has a member function called sort, with its signature being sort(isOrderedBefore: (T, T) -> Bool). This fun

2条回答
  •  猫巷女王i
    2021-01-03 21:30

    Chris Lattner suggests qualifying the name of the global function with Swift's default namespace, Swift. So you should be able to access the global version using: Swift.sort.

提交回复
热议问题