【发布时间】:2016-06-30 18:06:37
【问题描述】:
struct Test {
func isOk () -> Bool{
return true
}
var mapping: [Int: () -> Bool] = [
1: isOk
]
func test() -> Bool {
return mapping[1]()
}
}
我收到了这个错误:
Cannot convert value of type '(Test) -> () -> Bool' to expected dictionary value type '() -> Bool'
有什么想法吗?谢谢!
【问题讨论】:
标签: swift function dictionary swift2