I was asked in Reddit (https://www.reddit.com/r/learnprogramming/comments/7ru82l/i_was_thinking_of_using_d_haxe_or_another/) how would D handle the following similar D code. I'm surprised that both dmd and ldc provides no warnings even with -w argument passed.

import std.stdio;

void main()
{
        string foo = "foo";
        string* p1, p2;
        
        string*[] ls;
        ls ~= &foo;
        p1 = ls[0];
        ls.destroy();
        p2 = ls[0];
        writeln(p2);

}

Reply via email to