[Issue 3543] New: : ? operator can't find common type for interfaces

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 23 03:24:17 PST 2009


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

           Summary: : ? operator can't find common type for interfaces
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: nfxjfg at gmail.com


--- Comment #0 from nfxjfg at gmail.com 2009-11-23 03:24:15 PST ---
The following fails to compile, but I think it should be allowed:

interface Root {
}

interface A : Root {
}

interface B : Root {
}

bool bla;

void main() {
  A a;
  B b;
  Root r;
  //this works
  r = a;
  r = b;
  //this line fails, although there's an unambiguous common type "Root"
  r = bla ? a : b;
}

If the compiler rejects this intentionally, this bug report is a feature
request.

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


More information about the Digitalmars-d-bugs mailing list