[Issue 900] New: changing import order causes type mismatch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 28 08:47:50 PST 2007


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

           Summary: changing import order causes type mismatch
           Product: D
           Version: 1.004
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: torhu at yahoo.com


Tested with DMD 1.0 and 1.004 on winxp.

There are 4 files involved:

// palette.d
module palette;

struct RGB { }

=========================================
// color_inl.d
module color_inl;

//uncommenting this line will fix the problem
//import palette : RGB:

import color;

void _set_color(RGB* p) { }

=========================================
// color.d
module color;

// swapping the order of these two lines will also fix the problem
public import color_inl;
import palette : RGB;

=========================================
// dtest.d
import color;

void fade()
{
   RGB rgb;
   _set_color(&rgb);
}

void main() {}

========================================

C:\prog\test\D\bugtest>dmd test.d
test.d(6): function color_inl._set_color (int,RGB*) does not match parameter
types (int,RGB *)
test.d(6): Error: cannot implicitly convert expression (& rgb) of type RGB * to
RGB*


-- 



More information about the Digitalmars-d-bugs mailing list