www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15502] New: no property 'nsecs' for type

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

          Issue ID: 15502
           Summary: no property 'nsecs' for type
                    'MonoTimeImpl!cast(ClockType)0'
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: timothee.cour2 gmail.com

NOTE: This is a different bug from issue 15501, despite similar title.

$dmd_069_X -version=A -c -o- main.d
ok

dmd -version=A -c -o- main.d
Deprecation: function std.datetime.Clock.currSystemTick is deprecated - Use
core.time.MonoTime.currTime instead

so after applying the recommended fix (version(B)):
dmd -version=B -c -o- main.d
Error: no property 'nsecs' for type 'MonoTimeImpl!cast(ClockType)0'



----
void test() {
  version(A){
    import std.datetime;
    auto temp=Clock.currSystemTick().nsecs() * 1e-9;
  }

  version(B){
    static import core.time;
    auto temp=core.time.MonoTime.currTime.nsecs * 1e-9;
  }
}
----

--
Jan 02