```
fun chandle(key:Int,info:T){
letnew = dictionary[key] as! ((T)->(Void))
new(info)
}
//定义两个闭包变量类型不同
var closure1 :(Int)->(Void) = {
number in
println("number is\(number)")
}
var closure2 : (String)->(Void) = {
name in
println("name\(name)")
}
//把闭包放入字典中
var dictionary : [Int:Any] {
return[1:closure1,2:closure2]
}
//这里的key为String类型但是传入的信息是泛型可能是INt可能是String
```