Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test<T: Hashable> {}
- var d: Test<AnyHashable>? = nil
- let t = Test<String>()
- d = t // Cannot assign value of type 'Test<String>' to type 'Test<AnyHashable>?'
- var d: AnyHashable? = nil
- let t = "123"
- d = t // Works fine
Add Comment
Please, Sign In to add comment