我有以下功能:
func moveThing(thing: AnyObject,toLeft length: Int) {} func moveThing(thing: AnyObject,toRight length: Int) {}
但是,当我将其中一个函数作为参数传递时,编译器会抱怨“不明确地使用’moveThing’”
func exec(function: (AnyObject,Int) -> ()) {} exec(moveThing) // Apparently ambiguous exec(moveThing as (AnyObject,toLeft: Int) -> ()) // Still ambiguous
我怎样才能解决歧义?