Created
July 12, 2017 13:53
-
-
Save ezura/96a13906b69d42ab885942777eec8ce6 to your computer and use it in GitHub Desktop.
将来的にこういうのができるようになるっぽい?(任意の列挙子を全網羅の対象から外す) #swift #CodePiece
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 Enum { | |
case a | |
case b | |
@_downgrade_exhaustivity_check | |
case c | |
} | |
// Compile: OK (warning) | |
switch Enum.a { | |
case .a: break | |
case .b: break | |
// case .c: break // not need | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/apple/swift/blob/b115ae528679ddc953fb2f33ce4f1fb56e8f2502/test/stmt/nonexhaustive_switch_stmt_editor.swift#L8-L29