Created
April 3, 2019 19:36
-
-
Save mdebbar/1250c1a8b5a3dcb7a3a9dfe1384f0d96 to your computer and use it in GitHub Desktop.
Analyzer - switch exhaustiveness
This file contains hidden or 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 { | |
e1, | |
e2, | |
e3, | |
} | |
String getString(MyEnum value) { | |
switch (value) { | |
case MyEnum.e1: | |
return 'e1'; | |
case MyEnum.e2: | |
return 'e2'; | |
case MyEnum.e3: | |
return 'e3'; | |
} | |
} | |
void main() { | |
print(getString(MyEnum.e3)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment