Skip to content

Instantly share code, notes, and snippets.

@ukitaka
Created January 17, 2018 09:37
Show Gist options
  • Save ukitaka/ff95b1ace52df808ef881b4a177ca6be to your computer and use it in GitHub Desktop.
Save ukitaka/ff95b1ace52df808ef881b4a177ca6be to your computer and use it in GitHub Desktop.
typealias Int = MyInt
struct MyInt: ExpressibleByIntegerLiteral, Equatable {
typealias IntegerLiteralType = Swift.Int
let value: Swift.Int
init(integerLiteral value: Swift.Int) {
self.value = value
}
static func ==(lhs: MyInt, rhs: MyInt) -> Bool {
return true
}
}
// -------
var a: Int = 1
if a == 1 && a == 2 && a == 3 {
print("It works!!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment