Bug 15032 – [REG2.068.1] coverage output is discreted around the calls to map(), canFind(), filter()
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-09-09T01:46:00Z
Last change time
2015-09-09T21:47:36Z
Assigned to
nobody
Creator
jiki
Comments
Comment #0 by jiki — 2015-09-09T01:46:56Z
This is a 2.068.1 issue, not 2.068.0.
The coverage counts for the lines are ommited,
around some range operations holding lambdas.
Image:
|bool isParentOf(in Symbol p, in Symbol sym, in Scope scx ) {
| if (!p.hasBaseClass)
| return false;
| if (!sym)
| return false;
| auto names = sym.baseClasses;
0000000| if (names.canFind!((a,b)=>a==b)(p.name))
| return true;
| auto list = names.map!toAggrSym;
0000000| if (list.canFind!((n, p)=>isParentOf(p, n.s, n.scx))(p))
| return true;
| return false;
|}
Comment #1 by jiki — 2015-09-09T01:49:10Z
A reduced test case:
[command]
dmd -cov mod_a.d mod_b.d
[mod_a.d]
import std.string;
[mod_b.d]
import std.algorithm;
void main() {
int[] range; // this line should be counted
// but suppressed by this bug
// canFind, map, filter, and so on
range.canFind!((a,b)=>true)(0); // this line is counted(but wrong?)
}
[Output(mod_b.lst)]
...snipped...
| int[] range; // this line should be counted
| // but suppressed by this bug
| // canFind, map, filter, and so on
0000000| range.canFind!((a,b)=>true)(0); // this line is counted(but wrong?)
...snipped...
Note:
The order of mod_a.d and mod_b.d affects.
Comment #2 by jiki — 2015-09-09T07:32:25Z
(In reply to jiki from comment #1)
> [command]
> dmd -cov mod_a.d mod_b.d
Oops, please run 'mod_a' after the compile finished, of course.