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

Walter Bright <bugzi...@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Walter Bright <bugzi...@digitalmars.com> ---
Adding @safe to the lambda:

  void test() @safe
  {
    int var;
    scope int* p;
    static int* escape;
    static assert(!__traits(compiles, () @safe { escape = p; }));
  //    escape = p;
  }

and it compiles without error. The lambda does not inherit @safe from the
function. Perhaps it should, but that would be an enhancement request, and
would possibly break existing code. It should be the subject of a separate
issue.

--

Reply via email to