On Wednesday, 8 November 2017 at 03:05:22 UTC, codephantom wrote:
On Tuesday, 7 November 2017 at 21:32:26 UTC, Adam D. Ruppe wrote:
[...]

it's interesting how the compiler deals with scope.
---------------------------------------------------------------------------
// save this in a file named: write.d

import std.stdio;

void main()
{
    auto o = new Object;

// One of statements below will prevent this code from compiling.
    // Which one do you think it is?

    // btw. If I instead use gdc on debian, then it will
// compile both statements just fine, and will work as expected too.

    o.write;
    write(o);

}

--------------------------------------------------------------------------

Compiles fine with DMD: https://dpaste.dzfl.pl/95b896aa242f

Reply via email to