www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22680] New: safe hole with destructors


          Issue ID: 22680
           Summary:  safe hole with destructors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elronnd elronnd.net

C c;
class C {
        ~this()  safe {
                c = this;

This is accepted, but is unsafe.

I propose that destructors always be marked as 'scope'.

Jan 16 2022