Avatar
do { let x = true let y = false enum Foo { case hoge(Bool) case fuga } let foo = Foo.hoge(x) switch foo { case .hoge(x): print(x) case .hoge(y): print(y) case .fuga: print("fuga") } } /* error: MyPlayground.playground:6:5: error: switch must be exhaustive switch foo { ^ MyPlayground.playground:6:5: note: add missing case: '.hoge(_)' switch foo { ^ */ 変数へのマッチで思いついたけど、流石にこれは面倒見てくれないかw