Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Compiler error from valid model

Compiler error from valid model

Hello,

I noticed a strange behaviour in a simple model, which appears like a bug.

Code:


record Value
  Real a;
end Value;

function Func
  input Value v;
  output Real a;
algorithm
  a := v.a;
end Func;

model Model
  Value[1] values;
  Value v;
  Real a;
equation 
  v = values[1];
  a = Func(values[1]);  // This leads to a compilation error
  //a = Func(v);        // This does work
end Model;

model Test
  Model m(values = values);
  Value[1] values;
equation
  values[1].a = 1;
end Test;

Instantiating and checking the model proceeds without problems, however, building the model fails due to errors in the generated C code.
I am currently using OpenModelica trunk (r10809).

Regards,
Michael

Edit: Added missing record definition

Edited by: mburisch - Dec-22-11 18:58:25

Re: Compiler error from valid model

Ok, this seems to be an issue so I'll add it to the bug-tracker (with the missing declaration of the record Value).

Edit: http://openmodelica.org:8080/cb/issue/1671

Re: Compiler error from valid model

Ok, thank you for your reply and sorry for the missing record. For completness I added it to the initial post.

There are 0 guests and 0 other users also viewing this topic
You are here: