Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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")
}
@DivineDominion

This comment has been minimized.

Copy link
Owner Author

commented May 3, 2018

prints "true" :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.