Created
April 2, 2018 21:02
-
-
Save Agarunov/cb1384cb2793138c4d1783faebc15c15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declared inside framework | |
struct Point: Hashable { | |
let x: Float | |
let y: Float | |
init(x: Float, y: Float) { | |
self.x = x | |
self.y = y | |
} | |
} | |
// In the main app | |
extension Point { | |
init(x: Int, y: Int) { | |
// prohibited! | |
// self.x = Float(x) | |
// self.y = Float(y) | |
self.init(x: Float(x), y: Float(y)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment