@@ -12590,7 +12590,6 @@ algorithm
1259012590 end match;
1259112591end isOpElemWise;
1259212592
12593-
1259412593public function isFuncWithArrayInput
1259512594 input DAE.Type inType;
1259612595 output Boolean outBool;
@@ -12912,16 +12911,36 @@ algorithm
1291212911 local
1291312912 Env.Cache cache;
1291412913 Env.Env env;
12915- list<tuple<DAE.Operator, list<DAE.Type>, DAE.Type>> opList;
12914+ list<tuple<DAE.Operator, list<DAE.Type>, DAE.Type>> opList;
1291612915 DAE.Type type1,type2, otype;
1291712916 DAE.Exp exp1,exp2,exp;
1291812917 DAE.Const const1,const2, const;
1291912918 DAE.Operator oper;
1292012919 Absyn.Operator aboper;
12921- DAE.Properties prop;
12920+ DAE.Properties prop, props1, props2 ;
1292212921 Absyn.Exp absexp1, absexp2;
12923- Boolean lastRound;
12922+ Boolean lastRound;
1292412923
12924+ // handle tuple op non_tuple
12925+ case (_, _, aboper, props1 as DAE.PROP_TUPLE(type_ = _), exp1, props2 as DAE.PROP(type_ = _), exp2, _, _, _, _, _, _, _)
12926+ equation
12927+ false = Config.acceptMetaModelicaGrammar();
12928+ (prop as DAE.PROP(type1, const1)) = Types.propTupleFirstProp(props1);
12929+ exp = DAE.TSUB(inExp1, 1, type1);
12930+ (cache, exp, prop) = operatorDeoverloadBinary(inCache, inEnv, inOperator1, prop, exp, inProp2, inExp2, AbExp, AbExp1, AbExp2, inImpl, inSymTab, inPre, inInfo);
12931+ then
12932+ (inCache, exp, prop);
12933+
12934+ // handle non_tuple op tuple
12935+ case (_, _, aboper, props1 as DAE.PROP(type_ = _), exp1, props2 as DAE.PROP_TUPLE(type_ = _), exp2, _, _, _, _, _, _, _)
12936+ equation
12937+ false = Config.acceptMetaModelicaGrammar();
12938+ (prop as DAE.PROP(type2, const2)) = Types.propTupleFirstProp(props2);
12939+ exp = DAE.TSUB(inExp2, 1, type2);
12940+ (cache, exp, prop) = operatorDeoverloadBinary(inCache, inEnv, inOperator1, inProp1, inExp1, prop, exp, AbExp, AbExp1, AbExp2, inImpl, inSymTab, inPre, inInfo);
12941+ then
12942+ (inCache, exp, prop);
12943+
1292512944 case (_, _, aboper, DAE.PROP(type1,const1), exp1, DAE.PROP(type2,const2), exp2, _, _, _, _, _, _, _)
1292612945 equation
1292712946 false = typeIsRecord(Types.arrayElementType(type1));
@@ -12934,7 +12953,7 @@ algorithm
1293412953 prop = DAE.PROP(otype,const);
1293512954 warnUnsafeRelations(inEnv,AbExp,const, type1,type2,exp1,exp2,oper,inPre);
1293612955 then
12937- (inCache,exp, prop);
12956+ (inCache,exp, prop);
1293812957
1293912958 // The order of this two cases determines the priority given to operators
1294012959 // Now left has priority for all.
@@ -12950,17 +12969,17 @@ algorithm
1295012969 // If the right side is not record then (lastRound is true) which means we should print errors on this round (last one:).
1295112970 lastRound = not typeIsRecord(Types.arrayElementType(type2));
1295212971
12953- (cache, exp , prop) = userDefOperatorDeoverloadBinary(cache,env,aboper,absexp1,absexp2,type1,type2,inImpl,inSymTab,inPre,inInfo,lastRound /**/);
12954- (exp,_) = ExpressionSimplify.simplify(exp);
12972+ (cache, exp , prop) = userDefOperatorDeoverloadBinary(cache,env,aboper,absexp1,absexp2,type1,type2,inImpl,inSymTab,inPre,inInfo,lastRound /**/);
12973+ (exp,_) = ExpressionSimplify.simplify(exp);
1295512974 then
1295612975 (cache, exp, prop);
1295712976
1295812977 // if we have a record on the right side check for overloaded operators
1295912978 case(cache, env, aboper, DAE.PROP(type1, const1), exp1, DAE.PROP(type2, const2), exp2, _, absexp1, absexp2, _, _, _, _)
1296012979 equation
1296112980 true = typeIsRecord(Types.arrayElementType(type2));
12962- (cache, exp , prop) = userDefOperatorDeoverloadBinary(cache,env,aboper,absexp2,absexp1,type2,type1,inImpl,inSymTab,inPre,inInfo, true); /*we have tried left side*/
12963- (exp,_) = ExpressionSimplify.simplify(exp);
12981+ (cache, exp , prop) = userDefOperatorDeoverloadBinary(cache,env,aboper,absexp2,absexp1,type2,type1,inImpl,inSymTab,inPre,inInfo, true); /*we have tried left side*/
12982+ (exp,_) = ExpressionSimplify.simplify(exp);
1296412983 then
1296512984 (cache, exp, prop);
1296612985
@@ -13008,7 +13027,17 @@ algorithm
1300813027 Absyn.Operator aboper;
1300913028 DAE.Properties prop;
1301013029 Absyn.Exp absexp1;
13011-
13030+
13031+ // handle op tuple
13032+ case (_, _, aboper, DAE.PROP_TUPLE(type_ = _), exp1, _, _, _, _, _, _)
13033+ equation
13034+ false = Config.acceptMetaModelicaGrammar();
13035+ (prop as DAE.PROP(type1, const)) = Types.propTupleFirstProp(inProp1);
13036+ exp = DAE.TSUB(exp1, 1, type1);
13037+ (cache, exp, prop) = operatorDeoverloadUnary(inCache, inEnv, inOperator1, prop, exp, AbExp, AbExp1, inImpl, inSymTab, inPre, inInfo);
13038+ then
13039+ (cache, exp, prop);
13040+
1301213041 case (_, _, aboper, DAE.PROP(type1,const), exp1, _, _, _, _, _, _)
1301313042 equation
1301413043 false = typeIsRecord(Types.arrayElementType(type1));
0 commit comments