﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2370	Record input connectors wrongly interpreted by the OpenModelica compiler	mats.l.larsson@…	somebody	"It seems that the OpenModelica compiler wrongly interprets inputs based on record data types.

The three following models a,b,c are essentially the same model, but using different set ups of data types.

The use of scalar types (block a) compiles properly, as well as the use of vectorized data types (block b). However, when a record data type (block c) is used the compilation fails with error regarding a mismatch between the number of unknowns (2 equations and 4 unknowns are reported).

This is indeed very strange, since the instantiated model actually has the correct code (see below) that is equivalent to the manually coded block a:
{{{#!mo
// correct automatically generated code for block c
class inputoutput.c  
  input Real u.a;
  input Real u.b;
  output Real y.a;
  output Real y.b;
equation
  y.a = u.a;
  y.b = u.b;
end inputoutput.c;


package inputoutput

  record sig
    Real a,b;
  end sig;

// block a compiles with OpenModelica 1.9 r17338
  block a
    input Real a,b;
    output Real A,B;
  equation
    A = a;
    B = b;
  end a;

   // block b compiles with OpenModelica 1.9 r17338
  block b
    input Real u[2];
    output Real y[2];
  equation
    y = u;
  end b;

    // block cfails to compile with OpenModelica 1.9 r17338
  block c
    input sig u;
    output sig y;
  equation
    y = u;
  end c;
  annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), Diagram(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2})), uses(Modelica(version = ""3.2"")));
end inputoutput;
}}}"	defect	new	high	Future	Frontend	trunk			
