﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5678	Duplicated index name undetected in nested loops	philip.hannebohm@…	Per Östlund	"When defining nested for-loops, the index variable is not checked for duplication.

From what I can see, the specification is silent on this matter.

The following model shows this, it succeeds when model checked, but shouldn't, right?

{{{
package Nested
  model Example
    ""Example model with nested for loops""
    final parameter Integer M = 3 ""problem height"";
    final parameter Integer N = 4 ""problem width"";
    Real[M,N] A ""matrix"";
    Real[M] x ""vector"";
    Real[N] y ""vector"";
  equation
    x = {sin(2*3.1415926*time*i) for i in 1:M};
    y = {cos(2*3.1415926*time*i) for i in 1:N};
    for i in 1:M loop
      for i in 1:N loop
        A[i,i] = x[i]*y[i];
      end for;
    end for;
  end Example;
end Nested;
}}}"	discussion	closed	critical	1.14.0	New Instantiation		fixed	for loops, nested, duplicate index	Francesco Casella Karim Adbdelhak Adrian Pop Martin Sjölund
