Created
May 3, 2018 11:37
-
-
Save DivineDominion/12b96f625cb640dd88d4f0ebdf5f59fe 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
struct Foo: ExpressibleByBooleanLiteral { | |
var value: Bool | |
init(booleanLiteral value: BooleanLiteralType) { | |
self.value = value | |
} | |
} | |
func ==(lhs: Foo, rhs: Foo) -> Bool { | |
return lhs.value == rhs.value | |
} | |
let x = Foo(booleanLiteral: true) | |
if x == true { | |
print("true") | |
} else { | |
print("false") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
prints "true" :)