Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class StringType {}
- class URLType {}
- class Special<Type> {
- }
- extension Special where Type : StringType {
- static var path: String {
- return "A"
- }
- }
- extension Special where Type : URLType {
- static var path: URL {
- return URL(fileURLWithPath: "A")
- }
- }
- let p1: String = Special.path // "A"
- 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