﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3155	Wrong illegal subscript	Rüdiger Franke	Per Östlund	"6 models of the PowerSystems library fail for the reason reported here. See: 
   https://test.openmodelica.org/libraries/PowerSystems/BuildModelRecursive.html
The model
{{{
model Modulator
  parameter Integer m = 3;
  Modelica.Blocks.Interfaces.BooleanOutput[2 * m] gates;
  final parameter Integer[m] pgt = 1:2:2 * m - 1 ""positive gates"";
  final parameter Integer[m] ngt = 2:2:2 * m ""negative gates"";
initial algorithm
  for k in 1:3 loop
    gates[{pgt[k], ngt[k]}] := {true, false};
  end for;
equation
  for k in 1:3 loop
    when time > 0.5 then
      gates[{pgt[k], ngt[k]}] = pre(gates[{ngt[k], pgt[k]}]);
    end when;
  end for;
end Modulator;
}}}
generates the error:
{{{

[1] 08:38:24 Translation Error
Error occurred while flattening model Modulator

[2] 08:38:24 Translation Error
[/home/user/work/Modulator.mo: 8:5-8:45]: Variable gates[{pgt[k], ngt[k]}] not found in scope Modulator.$for loop scope$.

[3] 08:38:24 Translation Error
[/home/user/work/Modulator.mo: 8:5-8:45]: Illegal subscript {pgt[k], ngt[k]} for dimensions 6 in component gates[{pgt[k], ngt[k]}].
}}}"	defect	closed	high	1.9.2	Frontend	trunk	fixed		
