Summary: measureTime doesn't work with unsafe template
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos

--- Comment #0 from 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());

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:
------- You are receiving this mail because: -------

Reply via email to