Skip to content

Commit

Permalink
Fix fill/ones/zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Dec 17, 2020
1 parent 8b45ab9 commit 120d48b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion OMCompiler/Compiler/NFFrontEnd/NFBuiltinCall.mo
Expand Up @@ -1036,14 +1036,20 @@ protected
(arg, arg_ty, arg_var, arg_pur) := Typing.typeExp(arg, context, info);

if not InstContext.inFunction(context) then
if arg_var > Variability.PARAMETER or Structural.isExpressionNotFixed(arg) then
if arg_var > Variability.PARAMETER or arg_pur == Purity.IMPURE or
Structural.isExpressionNotFixed(arg) then
Error.addSourceMessageAndFail(Error.NON_PARAMETER_EXPRESSION_DIMENSION,
{Expression.toString(arg), String(index),
List.toString(fillArg :: dimensionArgs, Expression.toString,
ComponentRef.toString(fnRef), "(", ", ", ")", true)}, info);
end if;

Structural.markExp(arg);
arg := Ceval.evalExpBinding(arg);
arg := Expression.getScalarBindingExp(arg);
arg_ty := Expression.typeOf(arg);
else
evaluated := false;
end if;

// Each dimension argument must be an Integer expression.
Expand Down

0 comments on commit 120d48b

Please sign in to comment.