﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1583	array bug, independent of types	jlettau	jlettau	"Hello!

When I run the makefile of the attached ""array_bug.mo""-file I get the following error message:
{{{
""
gcc  -O3 -falign-functions -msse2 -mfpmath=sse   -I""F:/workspace/OpenModelica/build//include/omc"" -I.    -c -o lastrange.o lastrange.c
lastrange.c: In function `residualFunc3':
lastrange.c:322: error: conversion to non-scalar type requested
lastrange.c:324: error: conversion to non-scalar type requested
lastrange.c:326: error: invalid operands to binary -
lastrange.c:343: error: conversion to non-scalar type requested
lastrange.c:345: error: conversion to non-scalar type requested
lastrange.c:347: error: invalid operands to binary -
lastrange.c:364: error: conversion to non-scalar type requested
lastrange.c:366: error: conversion to non-scalar type requested
lastrange.c:368: error: invalid operands to binary -
lastrange.c:386: error: conversion to non-scalar type requested
lastrange.c:388: error: conversion to non-scalar type requested
lastrange.c:390: error: invalid operands to binary -
make: *** [lastrange.o] Error 1
""
}}}
this error message doesn`t depend on types. With Booleans it appears also.

{{{
// name:     strange_bug.mo
// keywords: mixed nonlinear problem
// status:   incorrect
// 
// 
function f
  input Real t;
  input Boolean i[2];
  output Boolean o[2];
algorithm
  o := if t > 0.5 then {not i[1],not i[2]} else {true,true};
end f; 

function fR
  input Real t;
  input Real i[2];
  output Real o[2];
algorithm
  o := if t > 0.5 then {sin(t)*i[1],sin(t)*i[2]} else {1.0,2.0};
end fR; 
 
model lastrange
  parameter Integer nIn = 2;
  Real bh[nIn];
  Real barr[nIn];
 equation
    barr = if sin(time)>0 then fR(0,bh) else fill(1.0,nIn);
    bh = if sin(time)<0 then fR(time,barr) else fill(3.0,nIn);
end lastrange; 
}}}"	defect	closed	blocker				fixed		jlettau
