[Issue 8450] New: measureTime doesn't work with unsafe template functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 26 18:27:24 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8450

           Summary: measureTime doesn't work with unsafe template
                    functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at dawgfoto.de 2012-07-26 18:27:22 PDT ---
cat > bug.d << CODE
import std.datetime, std.stdio;

void main()
{
    auto mt = measureTime!((a) {
        writefln("Running tests took: %s ms", a.msecs());
    })();
}
CODE

dmd bug

----

I only had a short look at this. I think the core issue is that
std.traits.isSafe doesn't work for template functions.
With v2.057 isSafe used to fail silently for template functions so the unsafe
measureTime overload was chosen and everything worked accidentally.
Since v2.058 isSafe will print an error but the @safe overload is selected.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list