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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 6 13:13:59 PDT 2011


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



--- Comment #10 from Walter Bright <bugzilla at digitalmars.com> 2011-04-06 13:10:03 PDT ---
(In reply to comment #9)
> One can always connect an imaginary root to all rootless interfaces and apply
> the rule I mentioned. Let me add that "?:" is a cornerstone operator for a lot
> of traits and type deduction paraphernalia (e.g. std.traits.CommonType). I
> wouldn't insist in the matter if it weren't important beyond the convenience of
> "?:" itself.

I agree about the importance of the ?: algorithm. But I wonder if the compiler
picking a common ancestor from a complex inheritance graph is really a good
thing - it may prove surprising to the user. For example:

interface A : B,C,D,E
interface X : M,N,O,C

Is it really the right idea to pick C for the common type? I'm skeptical.

-- 
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