Skip to content

Commit 03d92f7

Browse files
committed
- Enabled check for assignment to inputs - Fix remaining testcases git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13059 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent aafa18c commit 03d92f7

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Compiler/FrontEnd/Dependency.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,8 @@ algorithm
11571157
HashTable2.HashTable ht;
11581158
Absyn.ArrayDim ad;
11591159

1160-
case({},optPath,cname,(d,p,env,ht)) then d;
1161-
case(Absyn.NOSUB()::ad,optPath,cname,(d,p,env,ht)) then buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
1160+
case({},_,_,(d,p,env,ht)) then d;
1161+
case(Absyn.NOSUB()::ad,_,_,(d,p,env,ht)) then buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
11621162
case(Absyn.SUBSCRIPT(e)::ad,_,_,(d,p,env,ht)) equation
11631163
d = buildClassDependsInExp(e,optPath,cname,(d,p,env,ht));
11641164
d = buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));

Compiler/FrontEnd/Inst.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ algorithm
21212121
then fail();
21222122
case (_,_,DAE.MOD(_,_,{},_),_,_) then {};
21232123
case (_,_,DAE.NOMOD(),_,_) then {};
2124-
case (_,_,DAE.REDECL(_,_,_),pre,ty) then fail(); /*TODO, report error when redeclaring in Real*/
2124+
case (_,_,DAE.REDECL(_,_,_),_,_) then fail(); /*TODO, report error when redeclaring in Real*/
21252125
end matchcontinue;
21262126
end instRealClass;
21272127

@@ -2447,7 +2447,7 @@ algorithm
24472447
Error.addMessage(Error.TYPE_ERROR,{s1,s2});
24482448
then fail();
24492449

2450-
case(cache,env,id,SOME(v),_,expectedTp,_) equation
2450+
case(cache,env,_,SOME(v),_,expectedTp,_) equation
24512451
true = Flags.isSet(Flags.FAILTRACE);
24522452
Debug.fprintln(Flags.FAILTRACE, "instBuiltinAttribute failed for: " +& id +&
24532453
" value binding: " +& ValuesUtil.printValStr(v) +&
@@ -15010,7 +15010,7 @@ algorithm
1501015010
(cache, inEquations, {});
1501115011

1501215012
// handle empty case
15013-
case (cache, inEnv, inIH, inPre, {}, _, eEq, nEq) then (cache, listReverse(eEq), listReverse(nEq));
15013+
case (cache, _, _, _, {}, _, eEq, nEq) then (cache, listReverse(eEq), listReverse(nEq));
1501415014

1501515015
// connect, both expandable
1501615016
case (cache, env, _, _, (eq as SCode.EQUATION(SCode.EQ_CONNECT(crefLeft, crefRight, _, info)))::rest, _, eEq, nEq)

Compiler/FrontEnd/Patternm.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function elabPattern
162162
output Env.Cache outCache;
163163
output DAE.Pattern pattern;
164164
algorithm
165-
(outCache,pattern) := elabPattern2(cache,env,lhs,ty,info,Error.getNumErrorMessages(),allowTopLevelInputs);
165+
(outCache,pattern) := elabPattern2(cache,env,lhs,ty,info,Error.getNumErrorMessages(),false);
166166
end elabPattern;
167167

168168
protected function elabPattern2
@@ -1625,7 +1625,7 @@ algorithm
16251625
list<DAE.Exp> accExps;
16261626
list<DAE.Type> accTypes;
16271627

1628-
case (cache,env,{},_,_,st,performVectorization,pre,accExps,accTypes) then (cache,{},listReverse(accExps),listReverse(accTypes),st);
1628+
case (cache,env,{},_,_,st,_,_,accExps,accTypes) then (cache,{},listReverse(accExps),listReverse(accTypes),st);
16291629
case (cache,env,case_::rest,_,_,st,_,_,accExps,accTypes)
16301630
equation
16311631
(cache,elabCase,optExp,optType,st) = elabMatchCase(cache,env,case_,tys,impl,st,performVectorization,pre);
@@ -1669,7 +1669,7 @@ algorithm
16691669
Env.Env env;
16701670
Option<Interactive.SymbolTable> st;
16711671

1672-
case (cache,env,Absyn.CASE(pattern=pattern,patternGuard=patternGuard,patternInfo=patternInfo,localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,performVectorization,pre)
1672+
case (cache,env,Absyn.CASE(pattern=pattern,patternGuard=patternGuard,patternInfo=patternInfo,localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,_,_)
16731673
equation
16741674
(cache,SOME((env,DAE.DAE(caseDecls)))) = addLocalDecls(cache,env,decls,Env.caseScopeName,impl,info);
16751675
patterns = MetaUtil.extractListFromTuple(pattern, 0);
@@ -1683,7 +1683,7 @@ algorithm
16831683
then (cache,DAE.CASE(elabPatterns, dPatternGuard, caseDecls, body, elabResult, resultInfo, 0, info),elabResult,resType,st);
16841684

16851685
// ELSE is the same as CASE, but without pattern
1686-
case (cache,env,Absyn.ELSE(localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,performVectorization,pre)
1686+
case (cache,env,Absyn.ELSE(localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,_,_)
16871687
equation
16881688
// Needs to be same length as any other pattern for the simplification algorithms, etc to work properly
16891689
len = listLength(tys);

Compiler/Util/BaseHashTable.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ algorithm
270270
array<list<tuple<Key,Integer>>> hashvec;
271271
FuncsTuple fntpl;
272272
/* adding when already present => Updating value */
273-
case (key,(hashvec,varr,bsize,n,fntpl))
273+
case (_,(hashvec,varr,bsize,n,fntpl))
274274
equation
275275
(_,indx) = get1(key, hashTable);
276276
indx_1 = indx - 1;
@@ -563,7 +563,7 @@ algorithm
563563
local
564564
array<Option<tuple<Key,Value>>> arr_1,arr;
565565
Integer n,size;
566-
case ((n,size,arr),pos)
566+
case ((n,size,arr),_)
567567
equation
568568
(pos < size) = true;
569569
arr_1 = arrayUpdate(arr, pos + 1,NONE());

0 commit comments

Comments
 (0)