File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/com/intellij/plugins/haxe/ide/annotator/semantics Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,16 @@ private static boolean hasReturnPathsCovered(@Nullable PsiElement child) {
214214 for (HaxeSwitchCase haxeSwitchCase : switchCaseList ) {
215215 if (haxeSwitchCase instanceof HaxeDefaultCase ) {
216216 hasDefault = true ;
217+ }else {
218+ // check if we got cases with capture variables that cover remaining cases.
219+ List <HaxeSwitchCaseExpr > switchCaseExprList = haxeSwitchCase .getSwitchCaseExprList ();
220+ HaxeSwitchCaseExpr first = switchCaseExprList .getFirst ();
221+ PsiElement firstChild = first .getFirstChild ();
222+ if (firstChild instanceof HaxeEnumExtractedValue ) {
223+ hasDefault = true ;
224+ }else if (firstChild instanceof HaxeSwitchCaseCaptureVar ) {
225+ hasDefault = true ;
226+ }
217227 }
218228 HaxeSwitchCaseBlock switchCaseBlock = haxeSwitchCase .getSwitchCaseBlock ();
219229 if (switchCaseBlock != null ) {
You can’t perform that action at this time.
0 commit comments