From 65065879c169faabf68639e7ad0558c048861744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Franke?= Date: Wed, 10 Oct 2018 15:37:19 +0200 Subject: [PATCH] Detect enumeration type in arrays as well This is the same as for any basic type. Belonging to [master]: - OpenModelica/OMCompiler#2712 --- Compiler/FrontEnd/Types.mo | 2 +- Compiler/SimCode/SimCodeUtil.mo | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Compiler/FrontEnd/Types.mo b/Compiler/FrontEnd/Types.mo index 639a0cfc819..8cdef1c7913 100644 --- a/Compiler/FrontEnd/Types.mo +++ b/Compiler/FrontEnd/Types.mo @@ -844,7 +844,7 @@ public function isEnumeration "Return true if Type is the builtin String type." input DAE.Type inType; output Boolean outBoolean; algorithm - outBoolean := match(inType) + outBoolean := match(arrayElementType(inType)) case (DAE.T_ENUMERATION()) then true; else false; end match; diff --git a/Compiler/SimCode/SimCodeUtil.mo b/Compiler/SimCode/SimCodeUtil.mo index 5598f7a71dc..e4b4f7acc78 100644 --- a/Compiler/SimCode/SimCodeUtil.mo +++ b/Compiler/SimCode/SimCodeUtil.mo @@ -7076,6 +7076,8 @@ algorithm elseif isConst then addSimVar(simVar, SimVarsIndex.stringConst, simVars); end if; + else + Error.addInternalError("Failed to find SimVar list for Var: " + BackendDump.varString(dlowVar), sourceInfo()); end if; // external objects elseif BackendVariable.isExtObj(dlowVar) then