Skip to content

Commit

Permalink
#2829 Print errors for missing arguments
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22389 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 22, 2014
1 parent d5497ec commit bec64d2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -11129,24 +11129,31 @@ algorithm
// check types vectorized argument
case (cache,env,Absyn.NAMEDARG(argName = id,argValue = e),farg,slots,_,true,_,_,polymorphicBindings,_,pre,_,_,_)
equation
(cache,e_1,DAE.PROP(t,c1),_) = elabExpInExpression(cache, env, e, impl,st, true,pre,info);
(cache,e_1) = evalExternalObjectInput(isExternalObject, t, c1, cache, env, e_1, info);
vt = findNamedArgType(id, farg);
pr = findNamedArgParallelism(id,farg);
(cache,e_1,DAE.PROP(t,c1),_) = elabExpInExpression(cache, env, e, impl,st, true,pre,info);
(cache,e_1) = evalExternalObjectInput(isExternalObject, t, c1, cache, env, e_1, info);
(e_2,_,ds,polymorphicBindings) = Types.vectorizableType(e_1, t, vt, Env.getEnvPathNoImplicitScope(env));
slots_1 = fillSlot(DAE.FUNCARG(id,vt,c1,pr,NONE()), e_2, ds, slots, checkTypes,pre,info);
then (cache,slots_1,c1,polymorphicBindings);

// do not check types
case (cache,env,Absyn.NAMEDARG(argName = id,argValue = e),farg,slots,_,false,_,_,polymorphicBindings,_,pre,_,_,_)
equation
(cache,e_1,DAE.PROP(t,c1),_) = elabExpInExpression(cache,env, e, impl,st,true,pre,info);
(cache,e_1) = evalExternalObjectInput(isExternalObject, t, c1, cache, env, e_1, info);
vt = findNamedArgType(id, farg);
pr = findNamedArgParallelism(id,farg);
(cache,e_1,DAE.PROP(t,c1),_) = elabExpInExpression(cache,env, e, impl,st,true,pre,info);
(cache,e_1) = evalExternalObjectInput(isExternalObject, t, c1, cache, env, e_1, info);
slots_1 = fillSlot(DAE.FUNCARG(id,vt,c1,pr,NONE()), e_1, {}, slots,checkTypes,pre,info);
then (cache,slots_1,c1,polymorphicBindings);

case (cache, env, Absyn.NAMEDARG(argName = id), farg, slots, _, _, _, _, polymorphicBindings,_,pre,_,_,_)
equation
failure(_ = findNamedArgType(id, farg));
s1 = Absyn.pathStringNoQual(path);
Error.addSourceMessage(Error.NO_SUCH_ARGUMENT, {s1,id}, info);
then fail();

// failure
case (cache,env,Absyn.NAMEDARG(argName = id,argValue = e),farg,_,true /* 1 function */,true /* checkTypes */,_,_,_,_,pre,_,_,_)
equation
Expand Down

0 comments on commit bec64d2

Please sign in to comment.