Skip to content

Commit b882cdc

Browse files
committed
- Avoid overly optimistic switch-optimization
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9473 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 36a38dc commit b882cdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Compiler/FrontEnd/Patternm.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,9 @@ algorithm
749749
ix = findMinMod(ixs,1);
750750
then (DAE.ET_STRING(),ix);
751751
case ({},_,_,_) then (ty,0);
752-
case ({_},_,_,1) then (ty,0);
752+
// Sadly, we cannot switch a default uniontype as the previous case in not guaranteed
753+
// to succeed matching if it matches for subpatterns.
754+
case ({_},_,DAE.ET_INT(),1) then (ty,0);
753755
end match;
754756
end findPatternToConvertToSwitch2;
755757

0 commit comments

Comments
 (0)