blob: a9517617d004a6df9e6c04998e26fb9b9563d33f [file] [log] [blame]
// RUN: %target-typecheck-verify-swift
func dict() -> [AnyHashable: Any] {
return ["x": "y"]
}
func set() -> Set<AnyHashable> {
return ["x"]
}
func test() {
if let d = dict() as? [String: String] {
print(d)
}
if let s = set() as? Set<String> {
print(s)
}
}
func testLValueCoerce() {
var lvalue = "lvalue"
let map: [AnyHashable : Any] = [lvalue: lvalue]
lvalue = map[lvalue] as! String
}