http://d.puremagic.com/issues/show_bug.cgi?id=6196

           Summary: with statement with single statement breaks linking
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-06-22 
11:05:51 PDT ---
module test;
static import std.stdio;

void main()
{
    with (std.stdio) writeln();
}

OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\DOCUME~1\Andrej\LOCALS~1\Temp\.rdmd\rdmd-test.d-A365FA805A6F8950E12081529066367B\test-d-A365FA805A6F8950E12081529066367B.obj(test-d-A365FA805A6F8950E12081529066367B)
 Error 42: Symbol Undefined _D3std5stdio12__T7writelnZ7writelnFZv

This will work:
module test;
static import std.stdio;

void main()
{
    with (std.stdio) { writeln(); }
}

Note how in the next example the first `with` statement has curly braces and
references writeln(), it gets linked in, and the linker errors are gone for the
second `with` statement:

static import std.stdio;

void main()
{
    with (std.stdio) { writeln(); }
    with (std.stdio) writeln();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to