Thread overview
[Issue 6936] type combination is not commutative
Jul 19, 2014
Jonathan M Davis
Dec 17, 2022
Iain Buclaw
July 19, 2014
https://issues.dlang.org/show_bug.cgi?id=6936

--- Comment #1 from hsteoh@quickfur.ath.cx ---
Isn't this more a problem with type inference in the ternary '?' operator?

--
July 19, 2014
https://issues.dlang.org/show_bug.cgi?id=6936

Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com

--- Comment #2 from Jonathan M Davis <jmdavisProg@gmx.com> ---
(In reply to hsteoh from comment #1)
> Isn't this more a problem with type inference in the ternary '?' operator?

Yes. The ternary operator currently, incorrectly uses the type of its last argument rather than the common type of the second and third arguments.

It's essentially the same bug as issue# 3543, but this is with arrays, whereas 3543 specifically talks about classes and interfaces, so I'm not sure if it's actually a duplicate.

--
July 22, 2014
https://issues.dlang.org/show_bug.cgi?id=6936

--- Comment #3 from hsteoh@quickfur.ath.cx ---
Recently Kenji fixed array type deduction to work correctly with base classes. But I guess it still doesn't work properly with common interfaces, or, in this case, const-ness.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=6936

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--