www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9125] New: mixin + textual import = order of declaration dependence

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9125

           Summary: mixin + textual import = order of declaration
                    dependence
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



14:29:10 PST ---
Created an attachment (id=1166)
code sample that gets mixed in 

The test case are 2 files one is main and the other is being mixed in via
import("tables.d").

command line:
dmd -J. -c mixin_order.d

dmd is 2.061 from github master.

struct RleBitSet(T)
{
    this(const(T)[] arr)const{ }
}

auto asSet(T)(in SetEntry!T e)
{
    return RleBitSet!T(e.data);
}

//this way works 
//mixin(import("tables.d"));

immutable NFCN = asSet(NFC_QCN);
immutable NFCM = asSet(NFC_QCM);

//this doesn't
mixin(import("tables.d"));


//-------------------
// tables.d (also attached)
//-------------------
struct SetEntry(T)
{
    T[] data;
}

immutable NFC_QCN = SetEntry!uint([1,2,3,4]);
immutable NFC_QCM = SetEntry!uint([1,2,3,4]);


It is expected that mixin(import("...")) makes code appear to be effectively
pasted just there but obviously some processing step is missing as it doesn't
work this way.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9125




14:29:38 PST ---
Created an attachment (id=1167)
the test case itself

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9125


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------

          mime type|                            |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 08 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9125




06:15:20 PDT ---
Still fails with 2.064.

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