[Issue 18672] Error in @safe transitive propagation with associative arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 27 21:02:44 UTC 2018


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

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|@safe should be             |Error in @safe transitive
                   |transitively propagated     |propagation with
                   |                            |associative arrays
           Severity|enhancement                 |normal

--- Comment #1 from Seb <greensunny12 at gmail.com> ---
Argh I accidentally hit submit.

The reason for the resubmission is that the following code compiles fine
already:

cat > main.d << EOF
void main() @safe
{
    struct Foo
    {
        int i;
        ~this() // <- no need to annotate with @safe explicitly here
        {
            assert(1);
        }
        void m(){}  // <- no need to annotate with @safe explicitly here
    }

    Foo foo;
    foo.m();
}
EOF

So DMD already does transitively apply @safe, but apparently if it generated
for associative arrays this generation doesn't work in all cases.

--


More information about the Digitalmars-d-bugs mailing list