Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import UIKit
  2.  
  3. class A { required init() {} }
  4. class AA : A {}
  5. class AB : A {}
  6.  
  7.  
  8. func a<SomeType:A>() -> SomeType
  9. {
  10. return SomeType()
  11. }
  12.  
  13. func a<SomeType:A>() -> SomeType?
  14. {
  15. return nil
  16. }
  17.  
  18. let first : AA? = a()
  19. let second : AA = a()
  20. let third : AB? = a()
  21. let fourth : AB = a()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement