[Issue 16949] New: [Reg 2.073] confusing @safe error message for fields with unsafe destructors

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Dec 4 06:13:42 PST 2016


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

          Issue ID: 16949
           Summary: [Reg 2.073] confusing @safe error message for fields
                    with unsafe destructors
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

cat > bug.d << CODE
struct A
{
    ~this(){}
}

@safe struct B
{
    A a;
}
CODE
dmd -c bug -transition=safe

----
Error: cannot take address of parameter this in @safe function ~this
----

This should have been a deprecation instead of an error hidden by
-transition=safe, hence it's a diagnostic regression. Also missing the line
number btw.

The original useful error message was.
----
bug.d(6): Error: @safe destructor 'bug.B.~this' cannot call @system destructor
'bug.A.~this'
----

--


More information about the Digitalmars-d-bugs mailing list