﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1782	`or` is not strict in both operands, should it be?	adabe588@…	somebody	"The `or` boolean operator evaluates both operands, meaning `true or fail()` will fail. I could not find any information on the expected behavior in the MM 2.0 spec, but I think it makes more sense for it to not evaluate both operands unnecessarily. 

The following code `fail()`s since first is called, even though isEmpty returns true.

StrictOr.mo:
{{{
package StrictOr

public function isEmpty<A>
  input List<A> list;
  output Boolean result;
algorithm
  result := match(list)
    case {} then true;
    else false;
  end match;
end isEmpty;

public function first<A>
  input List<A> list;
  output A element;
algorithm
  element := match list
    local A x;
    case x::_ then x;
  end match;
end first;

function f
  output Boolean e;
protected
  List<List<Integer>> l := {};
algorithm
  e := isEmpty(l) or isEmpty(first(l));
end f;

end StrictOr;
}}}

StrictoOr.mos:
{{{
setCommandLineOptions({""+d=rml,noevalfunc,failtrace"",""+g=MetaModelica"",""+showAnnotations"",""+showErrorMessages""});

loadFile(""StrictOr.mo"");
getErrorString();

StrictOr.f();
getErrorString();
// Expected
// Result:
// true
// """"
// endResult
}}}"	defect	closed	high	1.9.0	Frontend		invalid		peter.fritzson@…
