﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2650	same instance name in several hierachical levels generate wrong crefs	Peter Aronsson	Adrian Pop	"Consider this simple example:

{{{
model A
  B pendulum annotation(Placement(visible = true, transformation(origin = {-22.679,7.56}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  model B
    inner Modelica.Mechanics.MultiBody.World world annotation(Placement(visible = true, transformation(origin = {-72.44499999999999,5}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Mechanics.MultiBody.Parts.BodyCylinder pendulum annotation(Placement(visible = true, transformation(origin = {0,2.165}, extent = {{-10,-10},{10,10}}, rotation = 0)));
    Modelica.Mechanics.MultiBody.Joints.Revolute revolute annotation(Placement(visible = true, transformation(origin = {-41.811,5}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  equation
    connect(revolute.frame_b,pendulum.frame_a) annotation(Line(visible = true, origin = {-16.959,3.583}, points = {{-14.852,1.417},{3.946,1.417},{3.946,-1.417},{6.959,-1.417}}));
    connect(world.frame_b,revolute.frame_a) annotation(Line(visible = true, origin = {-57.128,5}, points = {{-5.317,0},{5.317,0}}));
    annotation(Diagram(coordinateSystem(extent = {{-148.5,-105},{148.5,105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5,5})));
  end B;
  annotation(Diagram(coordinateSystem(extent = {{-148.5,-105},{148.5,105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5,5})));
end A;
}}}

It fails to generate code because it appends an extra 'pendulum' to a variable. If the outermost instance name is changed to something else than 'pendulum' it works fine.

Tested on 1.9.1+dev (r18826) 

"	defect	closed	high	1.9.1	Frontend	trunk	fixed		Adrian Pop
