Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. class StringType {}
  2. class URLType {}
  3.  
  4. class Special<Type> {
  5.  
  6. }
  7.  
  8. extension Special where Type : StringType {
  9.  
  10. static var path: String {
  11.  
  12. return "A"
  13. }
  14. }
  15.  
  16. extension Special where Type : URLType {
  17.  
  18. static var path: URL {
  19.  
  20. return URL(fileURLWithPath: "A")
  21. }
  22. }
  23.  
  24. let p1: String = Special.path // "A"
  25. let p2: URL = Special.path // A -- file:///private/var/folders/_7/n6n7cym527s7frqb6036mbpc0000gq/T/com.apple.dt.Xcode.pg/containers/com.apple.dt.playground.stub.iOS_Simulator.ezura-var-FCB0244E-CA4F-4AA2-A312-798BB8FFA2D4/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement