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

--- Comment #27 from Walter Bright <bugzi...@digitalmars.com> ---
For example, Line 213:

  static trustedCloseHandle(HANDLE hObject) @trusted
  {
    return CloseHandle(hObject);
  }

All this is doing is redefining an @system function as being @trusted, without
changing the interface to it, or checking, or doing anything at all to justify
it now being trusted.

It may be true that CloseHandle() actually is trustworthy - if that is the
case, the declaration of CloseHandle() needs to change from @system to
@trusted. On the other hand, if it is not trustworthy, papering it over with
such a wrapper and relying on the caller to use it correctly by convention has
the effect of totally defeating the compiler's ability to check code.

--

Reply via email to