Skip to content

Commit

Permalink
Fix for PowerSystems
Browse files Browse the repository at this point in the history
e44c8ff was not restrictive enough. It caused problems for:
  model M = SomeBlock;
We now only optimize if the restrictions are equal.
  • Loading branch information
sjoelund committed Apr 21, 2016
1 parent ad78c44 commit b3b9299
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Inst.mo
Expand Up @@ -2277,7 +2277,7 @@ algorithm

if match r
case SCode.Restriction.R_PACKAGE() then false;
else Mod.isInvariantMod(mod);
else if SCode.restrictionEqual(r,re) then Mod.isInvariantMod(mod) else false;
end match then
// Is a very simple modification on an operator record; we do not need to handle it by adding SCode.EXTENDS
// print("Short-circuit: " + SCodeDump.restrString(r)+" "+SCodeDump.restrString(re)+" : "+SCodeDump.printModStr(mod)+"\n");
Expand All @@ -2297,7 +2297,7 @@ algorithm

(cache, env, ih, store, dae, csets, ci_state, vars, bc, oDA, eqConstraint, graph) =
instClassdef2(cache, parentClassEnv, ih, store, mods_1, pre, ci_state, className, classDefParent,
re,
re /* = r */,
vis, partialPrefix, encapsulatedPrefix, // TODO: Do we need to merge these?
inst_dims, impl,
callscope, graph, inSets, instSingleCref,comment,info,stopInst);
Expand Down

0 comments on commit b3b9299

Please sign in to comment.