I want to create a Dictionary that does not limit the key type (like NSDictionary)
So I tried
var dict = Dictionary
Hashable is just a protocol so you can't specify it directly as a type for the Key value. What you really need is a way of expressing "any type T, such that T implements Hashable. This is handled by type constraints in Swift:
func makeDict(arr: T[]) {
let x = Dictionary()
}
This code compiles.
AFAIK, you can only use type constraints on generic functions and classes.