@@ -860,8 +860,10 @@ algorithm
860860 // depend on detection of assert or not
861861 if (listEmpty(assrtStmts))
862862 then // no assert detected
863+
863864 // output
864865 newExp = Expression . makeTuple(list( getReplacementCheckComplex(repl,cr,ty) for cr in lst_cr));
866+
865867 // compare types
866868 true = checkExpsTypeEquiv(e1, newExp);
867869 // input map cref again function args
@@ -1126,17 +1128,31 @@ algorithm
11261128 Option < DAE . Exp > binding;
11271129 DAE . Type tp;
11281130 DAE . Element elt;
1131+ DAE . Exp exp;
11291132 case ({},_,_,_,_) then (listReverse(iInputs),listReverse(iOutput),iBody,iRepl);
11301133 case (DAE . VAR (componentRef= cr,direction= DAE . INPUT ())::rest,_,_,_,_)
11311134 equation
11321135 (oInputs,oOutput,oBody,repl) = getFunctionInputsOutputBody(rest,cr::iInputs,iOutput,iBody,iRepl);
11331136 then
11341137 (oInputs,oOutput,oBody,repl);
1135- case (DAE . VAR (componentRef= cr,direction= DAE . OUTPUT ())::rest,_,_,_,_)
1138+
1139+ case (DAE . VAR (componentRef= cr,direction= DAE . OUTPUT (), binding= binding as SOME (exp))::rest,_,_,_,_)
1140+ equation
1141+ // use type of cref, since var type is different
1142+ // and has no hint on array or record type
1143+ tp = ComponentReference . crefTypeFull(cr);
1144+ st = listAppend(iBody, {DAE . STMT_ASSIGN (exp1 = Expression . crefExp(cr), exp = exp, source= DAE . emptyElementSource, type_= tp)});
1145+ (oInputs,oOutput,oBody,repl) = getFunctionInputsOutputBody(rest,iInputs,cr::iOutput,st,iRepl);
1146+ then
1147+ (oInputs,oOutput,oBody,repl);
1148+
1149+
1150+ case (DAE . VAR (componentRef= cr,direction= DAE . OUTPUT (), binding= NONE ())::rest,_,_,_,_)
11361151 equation
11371152 (oInputs,oOutput,oBody,repl) = getFunctionInputsOutputBody(rest,iInputs,cr::iOutput,iBody,iRepl);
11381153 then
11391154 (oInputs,oOutput,oBody,repl);
1155+
11401156 case (DAE . VAR (componentRef= cr,protection= DAE . PROTECTED (),binding= binding)::rest,_,_,_,_)
11411157 equation
11421158 // use type of cref, since var type is different
@@ -1729,6 +1745,7 @@ algorithm
17291745 exps = List . map1r(crs, VarTransform . getReplacement, repl);
17301746 then DAE . CALL (path,exps,DAE . CALL_ATTR (ty,false ,false ,false ,false ,DAE . NO_INLINE (),DAE . NO_TAIL ()));
17311747 end matchcontinue;
1748+
17321749end getReplacementCheckComplex;
17331750
17341751protected function getInlineHashTableVarTransform
0 commit comments