www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14825] New: Coverage analyzer should mark uninstantiated

https://issues.dlang.org/show_bug.cgi?id=14825

          Issue ID: 14825
           Summary: Coverage analyzer should mark uninstantiated template
                    code lines
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

http://www.digitalmars.com/d/archives/digitalmars/D/Rant_after_trying_Rust_a_bit_268458.html#N268741

A coverage report:
===============================
       |void foo (T) ()
       |{
       |    import std.stdio;
       |    static if (is(T == int))
      1|        writeln("1");
       |    else
       |        writeln("2");
       |}
       |
       |unittest
       |{
      1|    foo!int();
       |}
       |
foo.d is 100% covered
============================

The 'writeln("2");' should be marked as not covered.

--
Jul 25 2015