Switch statement cases not showing syntax error if a case is already present
See original GitHub issueSteps to Reproduce
void test(){
int a = 10;
switch(a) {
case 0: // looks OK
break;
case 0: // not OK, it should show syntax error
break;
}
}
Version info
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel dev, v1.3.13, on Mac OS X 10.14 18A389, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] iOS toolchain - develop for iOS devices (Xcode 10.1) [✓] Android Studio (version 3.3) [✓] Connected device (1 available)
• No issues found!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
bash switch-case statement gives syntax error - Stack Overflow
when using case statements, you need to end each clause with ;; : case $option in a ) # do something ;; b...
Read more >Spurious syntax error for certain switch-case-if scenario #7404
Type '(a: any) => { if(c: any): any; }' is not assignable to type 'number'. A function whose declared type is neither 'void'...
Read more >switch - JavaScript - MDN Web Docs - Mozilla
The switch statement evaluates an expression, matching the expression's value against a series of case clauses, and executes statements after the first case...
Read more >switch - Manual - PHP
The switch statement is similar to a series of IF statements on the same expression. In many occasions, you may want to compare...
Read more >switch statement - cppreference.com
If condition evaluates to a value that doesn't match any of the case: labels, and the default: label is not present, then none...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perfect. If you add a line to the
rules:
list,you should be good to go!
Did the trick. Thank you 😃
Edit: I wonder why it wasn’t included in the file by default, and if I need to find more rules like this, where can I find them?