[Issue 20847] New: confusing compiler error message when compiling PosixTimeZone.getTimeZone

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 19 17:58:00 UTC 2020


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

          Issue ID: 20847
           Summary: confusing compiler error message when compiling
                    PosixTimeZone.getTimeZone
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mingwu at gmail.com

$ cat t.d
import std.datetime.timezone;

class T {
  const string NEW_YORK_TIMEZONE = "America/New_York";
  public static const auto _timeZoneInfo =
PosixTimeZone.getTimeZone(NEW_YORK_TIMEZONE);
}

$ dmd -c t.d  # on Linux
/usr/include/dmd/phobos/std/file.d(1972): Error: lstat64 cannot be interpreted
at compile time, because it has no available source code

# not sure what it is about, e.g. which file it's looking for?

# on Windows
$ dmd.exe -c t.d
C:\project\dmd2\windows\bin64\..\..\src\phobos\std\file.d(1947): Error:
GetFileAttributesW cannot be interpreted at compile time, because it has no
available source code


# LDC on Linux
$ ldc2 -c t.d
/home/zhou/project/ldc2-1.20.0-linux-x86_64/bin/../import/std/file.d(1962):
Error: lstat64 cannot be interpreted at compile time, because it has no
available source code


# GDC on Linux:
$ gdc-10 -c t.d
/usr/lib/gcc/x86_64-linux-gnu/10/include/d/std/file.d:1565:21: error: lstat64
cannot be interpreted at compile time, because it has no available source code
 1565 |         return lstat(namez, &statbuf) == 0;
      |                     ^
/usr/lib/gcc/x86_64-linux-gnu/10/include/d/std/file.d:1524:22: note: called
from here: existsImpl(((Res __tmpfordtor2620 = tempCString(name);) ,
__tmpfordtor2620).ptr())
 1524 |     return existsImpl(name.tempCString!FSChar());
      |                      ^
/usr/lib/gcc/x86_64-linux-gnu/10/include/d/std/datetime/timezone.d:1957:37:
note: called from here: exists(tzDatabaseDir)
 1957 |         enforce(tzDatabaseDir.exists(), new
DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
      |                                     ^
/usr/lib/gcc/x86_64-linux-gnu/10/include/d/std/datetime/timezone.d:1957:16:
note: called from here: enforce(exists(tzDatabaseDir), delegate Throwable() =>
new TimeException(format("Directory %s does not exist.", tzDatabaseDir),
"/usr/lib/gcc/x86_64-linux-gnu/10/include/d/std/datetime/timezone.d", 1957LU,
null))
 1957 |         enforce(tzDatabaseDir.exists(), new
DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
      |                ^
t.d:5:69: note: called from here: getTimeZone(NEW_YORK_TIMEZONE,
"/usr/share/zoneinfo/")
    5 |   public static const auto _timeZoneInfo =
PosixTimeZone.getTimeZone(NEW_YORK_TIMEZONE);
      |                                                                     ^

--


More information about the Digitalmars-d-bugs mailing list