Changeset 13967
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/FrontEnd/SCodeDependency.mo
r13963 r13967 888 888 end markAsUsedOnRestriction2; 889 889 890 protected function checkNotExtendsDependent891 "Wrapper function for checkNotExtendsDependent2 which adds the error message892 count to the function arguments."893 input Absyn.Path inBaseClass;894 input Env inEnv;895 input Absyn.Info inInfo;896 output Boolean outResult;897 algorithm898 outResult := checkNotExtendsDependent2(inBaseClass, inEnv, inInfo,899 Error.getNumErrorMessages());900 end checkNotExtendsDependent;901 902 protected function checkNotExtendsDependent2903 "The Modelica specification 3.2 says (section 5.6.1): 'The lookup of the names904 of extended classes should give the same result before and after flattening905 the extends. One should not find any element used during this flattening by906 lookup through the extends-clauses.' This means that it's not allowed to have907 a name in an extends-clause that's inherited from another extends-clause. This908 function checks this, and returns true if an extends doesn't depend on an909 extend in the local scope."910 input Absyn.Path inBaseClass;911 input Env inEnv;912 input Absyn.Info inInfo;913 input Integer inErrorCount;914 output Boolean outResult;915 algorithm916 outResult := matchcontinue(inBaseClass, inEnv, inInfo, inErrorCount)917 local918 Absyn.Path bc;919 Absyn.Ident id;920 String bc_name;921 922 case (_, _, _, _)923 equation924 id = Absyn.pathFirstIdent(inBaseClass);925 bc :: _ = SCodeLookup.lookupBaseClasses(id, inEnv);926 bc_name = Absyn.pathString(bc);927 Error.addSourceMessage(Error.EXTENDS_INHERITED_FROM_LOCAL_EXTENDS,928 {bc_name, id}, inInfo);929 then930 false;931 932 else933 equation934 true = intEq(inErrorCount, Error.getNumErrorMessages());935 then936 true;937 938 end matchcontinue;939 end checkNotExtendsDependent2;940 941 890 protected function analyseExtends 942 891 "Analyses an extends-clause." -
trunk/testsuite/flattening/libraries/msl31/fluid/Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts.mos
r13930 r13967 75 75 // Continuing flattening by only considering the 'outer' component declaration. 76 76 // 77 // Class Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts has 2 2equation(s) and 23 variable(s).78 // 1 3of these are trivial equation(s).77 // Class Modelica.Fluid.Examples.AST_BatchPlant.BaseClasses.TankWithTopPorts has 20 equation(s) and 23 variable(s). 78 // 11 of these are trivial equation(s). 79 79 // " 80 80 // "" -
trunk/testsuite/flattening/libraries/msl31/fluid/Modelica.Fluid.Fittings.MultiPort.mos
r13930 r13967 18 18 // output Real y; 19 19 // algorithm 20 // y := max(x, 1e-10);20 // y := max(x, 0.0000000001); 21 21 // end Modelica.Fluid.Fittings.MultiPort.positiveMax; 22 22 // … … 44 44 // port_a.h_outflow = 1.0; 45 45 // port_a.m_flow = 0.0; 46 // ports_b[0].m_flow = 0.0;47 46 // end Modelica.Fluid.Fittings.MultiPort; 48 47 // " … … 51 50 // 52 51 // 53 // Class Modelica.Fluid.Fittings.MultiPort has 4equation(s) and 3 variable(s).54 // 4of these are trivial equation(s).52 // Class Modelica.Fluid.Fittings.MultiPort has 3 equation(s) and 3 variable(s). 53 // 3 of these are trivial equation(s). 55 54 // " 56 55 // ""
Note: See TracChangeset
for help on using the changeset viewer.