Last active
October 20, 2015 17:56
-
-
Save yannickl/ef5c59f07836b2ac320e to your computer and use it in GitHub Desktop.
Behavior change between Debug and Release modes with XCode7 and Swift2
This file contains 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
enum MyEnum { | |
case Foo | |
case Bar(param: Int) | |
case Baz | |
func isFoo() -> Bool { | |
if case .Foo = self { | |
return true | |
} | |
return false | |
} | |
func isBaz() -> Bool { | |
if case .Baz = self { | |
return true | |
} | |
return false | |
} | |
} | |
let a: MyEnum = .Baz | |
print(a.isFoo()) // "false" in debug mode, "true" in release mode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment