Skip to content

Instantly share code, notes, and snippets.

@andyyhope
Created December 20, 2016 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyyhope/8e73250f321ef3c952c0fab283002053 to your computer and use it in GitHub Desktop.
Save andyyhope/8e73250f321ef3c952c0fab283002053 to your computer and use it in GitHub Desktop.
struct Foo { }
enum Bar {
case hero(Any)
}
let foo = Foo()
let bar = Bar.hero(foo)
if case let .hero(foo) = bar, foo is Foo {
print(“This works”)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment