- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compiler error from valid model
Page Start Prev 1 Next End
Compiler error from valid model
Compiler error from valid model
Dec-22-11 12:53:07
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
Dec-22-11 17:30:13
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
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compiler error from valid model
There are 0 guests and 0 other users also viewing this topic