Changeset efdb564 in OpenModelica


Ignore:
Timestamp:
2021-11-23T12:24:01+01:00 (2 years ago)
Author:
Mahder Gebremedhin <mahder.geb@…>
Parents:
0aeaad6
git-author:
Mahder Gebremedhin <mahder.geb@…> (11/22/21 17:36:25)
git-committer:
Mahder Gebremedhin <mahder.geb@…> (11/23/21 12:24:01)
Message:

Handle functions returning enumerations.

  • A case was missing for enumeration type return functions.
  • If the function fails always report an error.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/BackEnd/CommonSubExpression.mo

    r632d2164 refdb564  
    14371437    then (value, inIndex + 1);
    14381438
     1439    case DAE.T_ENUMERATION() equation
     1440      str = inPrefix + intString(inIndex);
     1441      cr = DAE.CREF_IDENT(str, inType, {});
     1442      value = DAE.CREF(cr, inType);
     1443    then (value, inIndex + 1);
     1444
    14391445    case DAE.T_CLOCK() equation
    14401446      str = inPrefix + intString(inIndex);
     
    14761482
    14771483    else equation
    1478       if Flags.isSet(Flags.DUMP_CSE_VERBOSE) then
    1479         print("  - createReturnExp failed for " + Types.printTypeStr(inType) + "\n");
    1480       end if;
     1484      Error.addInternalError("  - createReturnExp failed for " + Types.printTypeStr(inType) + "\n", sourceInfo());
    14811485    then fail();
    14821486  end match;
Note: See TracChangeset for help on using the changeset viewer.