On Saturday, 21 October 2017 at 22:50:51 UTC, Walter Bright wrote:
What's happening here is each of the operands of || are
considered to be separate statements as far as coverage
analysis goes. It becomes clearer if it is reformatted as:
1| x = 2;
1| if (x == 1 ||
1| x == 2)
or:
3| x = 2; if (x == 1 || x == 2)
What about (adding a flag) making coverage operate at the
expression level instead? Meaning that each coverage result would
be associated with a column offset and length aswell as the line
number.
Of course the program would run much slower...