﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5658	Wrong error message when using some built-in function (abs, mod) with undefined variables as arguments	Pierre Haessig <pierre.haessig@…>	somebody	"Dear Maintainers,

On OM version 1.13.2, I get wrong error messages when I use ''some'' built-in functions with undefined variables as arguments. Here is a minimal example.

{{{
model ModelUndefVarBug
 Real x;
equation

x = abs(a);

end ModelUndefVarBug;
}}}

Checking this model in OMEdit yields a translation error (this is expected) which erroneously complains that `abs` is undefined (although true the problem is that variable a is not defined):

{{{
[ModelUndefVarBug: 5:1-5:11]: No matching function found for abs in component <NO COMPONENT>
candidates are .OpenModelica.Internal.intAbs<function>(Integer v) => Integer
 -.OpenModelica.Internal.realAbs<function>(Real v) => Real
}}}


The same problem appears with the `mod` function, but not with most others. For example, if I replace the equation with `x = sin(a);`, I get an expected translation error message:

{{{
[ModelUndefVarBug: 5:1-5:11]: Variable a not found in scope ModelUndefVarBug.
}}}

I don't know if other functions are affected. I tested quite a few from Modelica 3.4 spec, §3.7 (Built-in Intrinsic Operators with Function Syntax). mod and abs are the only one I found affected, but my test was not exhaustive.

Although a minor issue, this type of wrong error message makes debugging Modelica models harder than it needs.

Best,
Pierre"	defect	closed	low	1.14.0	*unknown*	v1.13.2	fixed		
